Jump to content
  • Advertisement
Sign in to follow this  
EvilNando

OpenGL glBatch draw

This topic is 2611 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI Im just starting opengl and I was wondering how the basic of rendering works


Im currently using 2 main classes for performing rendering on screen

one is the GLBatch class for storing vertices , the other is GLShaderManager for setting basic stock shaders


the thing is that since these two objects are separate classes how do they know of each other?

given a simple rendering call



// Draw
shaderManager.UseStockShader(GLT_SHADER_FLAT, ProjectionMatrix, myColor);
floorBatch.Draw();



on the program's source I never get to set any pointers or global references to the shader manager and browsing the code for glbatch Draw() function only points me to a empty virtual method

thanks

Share this post


Link to post
Share on other sites
Advertisement
GLBatch and GLShaderManager are not part of OpenGL. You need to ask your team who created those classes and he will change it to your liking.

Share this post


Link to post
Share on other sites

GLBatch and GLShaderManager are not part of OpenGL. You need to ask your team who created those classes and he will change it to your liking.


Oh yes youre right those classes belong to the GLTools library :S

Share this post


Link to post
Share on other sites
SuperBible 5, right? Read on, Chapter 6 explains it.
As far as I understand it, UseStockShader changes the state of the OpenGL state machine. Then this changed state is "saved/used" until you modify the state (in this case, the shader applied) again (for example if you call UseStockShader again, then THIS state is used). Another example: glEnable(GL_DEPTH_TEST) enables depth testing until you disable it again with glDisable(), and it's the same with UseStockShader (glUseProgram(...))

I hope you understood it :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!