Advertisement Jump to content
Sign in to follow this  
bojkarPL

[.net] csgl - multitexturing

This topic is 4952 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!