int CMapCreationEngine::DrawGLScene()
{
//Setup Drawing Area Back Colour
glClearColor(m_BackColour.fRed, m_BackColour.fGreen, m_BackColour.fBlue, m_BackColour.fAlpha);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw the Grid if Required
glTranslatef(2.5f, -1.5f, -6.0f);
glBegin(GL_TRIANGLES);
glColor3f(1.0f, 0.0f, 1.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glColor3f(1.0f, 1.0f, 1.0f);
glVertex3f(1.0f, -1.0f, 0.0f);
glEnd();
glTranslatef(-2.5f, 1.5f, 6.0f);
glBegin(GL_LINES);
glColor3f(1.0f, 1.0f, 1.0f);
glVertex2d(5, 5);
glVertex2d(-5,-5);
glEnd();
SwapBuffers(wglGetCurrentDC());
return TRUE;
}
1 Simple Question and a request for advice !
OK, I have what I hope is a really simple question, and a much more complex one.
Please bear with me as I am an OGL newbie.
I have implemented a simple OGL class (using MFC) to draw a triangle and a line to a screen. The triangle works fine, but I can''t get the line to appear. (I have been thru what I have of NeHe''s documents and I seem to be using the same structure of code as he does). I will paste the code at the bottom of this message.
Also, (again using MFC) I want to implement a colour picker popup box, and have the colours selected displayed on my OGL context. Does anyone have any ideas / hints / advice on the best way to do (or not to do this) - I am open to ideas on the design of the popup too, as I don''t want a huge array of buttons, but I only want a subset of colours for the user (say 32) to pick from .
thanks in advance for any help I recieve,
Bp. (Code pasted below. Triangle works as expected, lines are no where to be seen)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement