Exemplo n.º 1
0
PaintGrouper::PaintGrouper(const char* name)
{
	CHECK_FOR_GL_ERROR;

#if TARGET_OS_IPHONE
	glPushGroupMarkerEXT(0, name);
	CHECK_FOR_GL_ERROR;
#else
	(void)name;
#endif
}
Exemplo n.º 2
0
static void
draw(void)
{
   if (GLAD_GL_EXT_debug_marker) {
       glPushGroupMarkerEXT(0, __FUNCTION__);
   }

   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

   if (GLAD_GL_EXT_debug_marker) {
       glPopGroupMarkerEXT();
   }

   glfwSwapBuffers(window);
}
Exemplo n.º 3
0
void dreamTorusReshape( int w, int h ) {
    width = w;
    height = h;

    float a = float(w)/float(h);

    glPushGroupMarkerEXT(0, "reshape");

    glViewport(0, 0, width, height);
    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    if( a > 1 ) {
        glFrustum( -0.1 * a, 0.1 * a, -0.1, 0.1, 0.1, 100.0 );
    } else {
        glFrustum( -0.1, 0.1, -0.1 / a, 0.1 / a, 0.1, 100.0 );
    }
    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();
    glTranslatef( 0, 0, -2 );

    glPopGroupMarkerEXT();
}
Exemplo n.º 4
0
static void drawAnObject()
{
  glPushGroupMarkerEXT(0, "drawAnObject");

  Torus t( 0.7f, 0.2f );
  int I = 30;
  int J = 30;
  glColor3f( 0.8f, 0.8f, 0.8f );
  for(int j = 0; j < J / 2 - 1; j++)
  {
    float v0 = (j+0.0f)/(J-1.0f);
    float v1 = (j+1.0f)/(J-1.0f);
    glBegin( GL_TRIANGLE_STRIP );
    for(int i = 0; i < I; i++)
    {
      float u = i/(I-1.0f);
      t.Vertex( u, v1 );
      t.Vertex( u, v0 );
    }
    glEnd();
  }

  glPopGroupMarkerEXT();
}
Exemplo n.º 5
0
void dreamTorusDisplay( bool clear )
{
    static float r = 0.0f;
    static int count = 0;

    if( count == 0 ) {
        init();
    }

    glPushGroupMarkerEXT(0, "display");

#if 1
    if( count == 0 ) {
        RegalSetErrorCallback( regalerr );
    } else if( count == 11 ) {
        RegalSetErrorCallback( NULL );
    }
    count++;
#endif

    glUseProgram( 0 );
    if( clear ) {
        glClearDepth( 1.0 );
        glClearColor( r / 400.f, 0, 0, 0);
        glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    }
    glEnable( GL_DEPTH_TEST );

    for( int i = 0; i < 8; i++ ) {
        glActiveTexture( GL_TEXTURE0 + i );
        glDisable( GL_TEXTURE_2D );
    }

    glBindMultiTextureEXT( texunit, GL_TEXTURE_2D, tex );
    glActiveTexture( texunit );
    glEnable( GL_TEXTURE_2D );


    float sc = 2.0f * fabs( ( count % 800 ) / 400.0f - 1.0f ) + 1.0f;

    glMatrixLoadIdentityEXT( texunit );
    glMatrixScalefEXT( texunit, sc, 1, 1 );

    float osc = sc * 0.5f;


    glEnable( GL_FOG );

    if( ( count % 7 ) == 0 || ( count % 17 ) == 0 ) {
        glDisable( GL_NORMALIZE );
        glEnable( GL_RESCALE_NORMAL );
        glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
        glMatrixMode( GL_MODELVIEW );
        glPushMatrix();
        glRotatef( (float) count, -1.0f, 1.0f, 0.0f );
        glScalef( osc, osc, osc );
        drawAnObject();
        glPopMatrix();
    } else {
        glEnable( GL_NORMALIZE );
        glDisable( GL_RESCALE_NORMAL );
        glMultiTexEnviEXT( texunit, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
        glMatrixPushEXT( GL_MODELVIEW );
        glMatrixRotatefEXT( GL_MODELVIEW, (float) count, -1.0f, 1.0f, 0.0f );
        glMatrixScalefEXT( GL_MODELVIEW, osc, osc, osc );
        drawAnObject();
        glMatrixPopEXT( GL_MODELVIEW );
    }

    r += 1.0f;
    if( r > 399 ) {
        r = 0.0f;
    }

    glPopGroupMarkerEXT();

  //printf( "Draw with r=%f\n", r );
}
Exemplo n.º 6
0
static void init()
{
    glPushGroupMarkerEXT(0, "init");

    glGenTextures( 1, &tex );
    GLubyte pix[] = {
        0x60, 0xff, 0x00, 0xff,  0xff, 0x00, 0x00, 0xff,  0xff, 0x00, 0xff, 0xff,  0x00, 0xff, 0xff, 0xff,
        0xff, 0xff, 0xff, 0xff,  0x00, 0x00, 0xff, 0xff,  0x00, 0x00, 0x00, 0xff,  0xff, 0x80, 0x00, 0xff,
        0x80, 0x80, 0xff, 0xff,  0xff, 0x00, 0x00, 0xff,  0x80, 0x80, 0x80, 0xff,  0x00, 0x80, 0x80, 0xff,
        0x00, 0xff, 0xff, 0xff,  0x00, 0x80, 0x00, 0xff,  0x80, 0x00, 0xff, 0xff,  0x00, 0x00, 0x80, 0xff
    };
    glTextureImage2DEXT( tex, GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, pix );
    glTextureParameteriEXT( tex, GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
    glTextureParameteriEXT( tex, GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
    glBindMultiTextureEXT( texunit, GL_TEXTURE_2D, tex );

    GLfloat mat_specular[]   = { 0.0f, 0.0f, 1.0f, 1.0f };
    GLfloat mat_shininess[]  = { 50.0f };
    GLfloat light_position[] = { 1.0f, 1.0f, 0.2f, 1.0f };
    GLfloat light_atten[]    = { 1.0f, 1.0f, 1.0f };
    GLfloat light_diffuse[]  = { 10.0f, 10.0f, 10.0f, 10.0f };
    GLfloat light_specular[] = { 10.0f, 10.0f, 10.0f, 10.0f };
    GLfloat light_spotdir[]  = { -0.1f, -0.1f, -1.0f };
    GLfloat light_spotcut[]  = { 30.0f };
    GLfloat light_spotexp[]  = { 3.0f };
    glClearColor (0.0, 0.0, 0.0, 0.0);
    //glShadeModel (GL_SMOOTH);

    glMatrixPushEXT( GL_MODELVIEW );
    glMatrixLoadIdentityEXT( GL_MODELVIEW );

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
    //glMaterialfv(GL_BACK, GL_SHININESS, mat_shininess);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);
    glLightf( GL_LIGHT0, GL_LINEAR_ATTENUATION, light_atten[1] );
    glLightf( GL_LIGHT0, GL_QUADRATIC_ATTENUATION, light_atten[2] );
    glLightfv( GL_LIGHT0, GL_DIFFUSE, light_diffuse );
    glLightfv( GL_LIGHT0, GL_SPECULAR, light_specular );
    glLightfv( GL_LIGHT0, GL_SPOT_DIRECTION, light_spotdir );
    glLightfv( GL_LIGHT0, GL_SPOT_CUTOFF, light_spotcut );
    glLightfv( GL_LIGHT0, GL_SPOT_EXPONENT, light_spotexp );
    //GLfloat light_ambient[] = { 0.0, -1.0, 0.0, 0.0 };
    //glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);

    glMatrixPopEXT( GL_MODELVIEW );

    glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE );
    glLightModelf( GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR );

    glEnable( GL_COLOR_MATERIAL ) ;
    glColorMaterial( GL_BACK, GL_SPECULAR );

    glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);

    glFogi( GL_FOG_MODE, GL_LINEAR );
    glFogf( GL_FOG_START, 2.0f );
    glFogf( GL_FOG_END, 4.0f );
    GLfloat fog_color[] = { 1.0, 1.0, 0.0, 0.0 };
    glFogfv( GL_FOG_COLOR, fog_color );

    glEnable( GL_CLIP_PLANE3 );
    GLdouble clip[] = { 1, 1, -1, 0 };
    glClipPlane( GL_CLIP_PLANE3, clip );

    glPopGroupMarkerEXT();
}
Exemplo n.º 7
0
// static int indent = 0;
inline void start_group(const std::string &str) {
    glPushGroupMarkerEXT(0, str.c_str());
    // fprintf(stderr, "%s%s\n", std::string(indent * 4, ' ').c_str(), str.c_str());
    // indent++;
}
Exemplo n.º 8
0
void OsmAnd::GPUAPI_OpenGLES2::glPushGroupMarkerEXT_wrapper(GLsizei length, const GLchar* marker)
{
    GL_CHECK_PRESENT(glPushGroupMarkerEXT);
    glPushGroupMarkerEXT(length, marker);
}
Exemplo n.º 9
0
static void GLAPIENTRY
extPushDebugGroup(GLsizei length, const char *message) {
   if (length < 0) length = 0;
   glPushGroupMarkerEXT(length, message);
}