Sign in to follow this  
bojkarPL

[.net] csgl - multitexturing

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this