Hi, im using SFML+OGL and i use SFML only for Window and Input stuff.
Ive got a problem
here is my initgl function
int CGra::InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
glEnable(GL_TEXTURE_2D); // Enable Texture Mapping ( NEW )
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
return TRUE; // Initialization Went OK
}
here is my drawing function
int CGra::DrawGLScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(-1.5f,0.0f,-6.0f);
glColor3f(1.0f,0.0f,0.0f);
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd();
glPopMatrix();
glFlush();
return TRUE;
}
ive got NO more functions that use GL(only bitmaps loading using SOIL lbirary)..
The triangle is not being drawn ;( If i draw sprites using OGL functions its okay, but simple primitives doesnt work
why?
i use PreverveOpenGlStates