Jump to content

OpenGL drawing not working with Framework


SpiderPig
 Share

Recommended Posts

I use OpenGL to render my sprites which work fine with the framework commands except for Godrays and DOF.

 

The process is first initiated by the following code;

void Begin(void)
{
 int vPort[4];
 glGetIntegerv(GL_VIEWPORT, vPort);
 // Set the projection
 glOrtho(0, vPort[2], vPort[3], 0, 1.0, 1000.0);/
 // Reset transformation
 glMatrixMode(GL_MODELVIEW);
 glPushMatrix();
   glLoadIdentity();

glEnableClientState(GL_VERTEX_ARRAY);
//glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

 glEnable(GL_BLEND);
 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 glEnable(GL_CULL_FACE);
 glCullFace(GL_BACK);
 glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}

 

void End(void)
{
 glMatrixMode(GL_MODELVIEW);
glPopMatrix();
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_TEXTURE_2D);
 glDisable(GL_BLEND);
glDisable(GL_CULL_FACE);
 glColor4f(1.0, 1.0, 1.0, 1.0);
}

 

I've had this problem for some time time now and I have worked around it by simply not using Godrays or DOF. biggrin.png

Can anyone please confirm that the code above is all there? Oh, and I call Begin() right after RenderFramework() too. Thanks smile.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...