Jump to content
  • Advertisement
Sign in to follow this  

[.net] csgl - multitexturing

This topic is 4858 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

i have problem with multitexturing in csgl:/ I was searching this error 3h :/ Look at code: public OpenGLTExture2D tex,tex2; // //funcion to add new textures private OpenGLTexture2D LoadTexture(string path) { return new OpenGLTexture2D(path); } ..... in Init opengl I add 2 new texture tex = LoadTexture("1.jpg"); tex2 = LoadTexture("2.jpg"); and render this shit in main loop (in this code program was crash) : tex.glActiveTextureARB(GL.GL_TEXTURE0_ARB); GL.glBindTexture(GL.GL_TEXTURE_2D, tex.ID); GL.glEnable(GL.GL_TEXTURE_2D); tex.glActiveTextureARB(GL.GL_TEXTURE1_ARB); GL.glBindTexture(GL.GL_TEXTURE_2D, tex2.ID); GL.glEnable(GL.GL_TEXTURE_2D); GL.glBegin(GL.GL_QUADS); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE0_ARB, 0, 0); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE1_ARB, 0, 0); GL. glVertex3f(-1.0f, -1.0f, 1.0f); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE0_ARB, 1, 0); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE1_ARB, 1, 0); GL.glVertex3f( 1.0f, -1.0f, 1.0f); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE0_ARB, 1, 1); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE1_ARB, 1, 1); GL.glVertex3f( 1.0f, 1.0f, 1.0f); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE0_ARB, 0, 1); tex.glMultiTexCoord2fARB(GL.GL_TEXTURE1_ARB, 0, 1); GL.glVertex3f(-1.0f, 1.0f, 1.0f); GL.glEnd(); do you know what is wrong? Plise helpe me! Thanks!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!