Skip to main content
gamedev.net
🔒 Locked

hmm some texturing problems

Started by DMINATOR 1 reply 850+ views
Original Post
DMINATOR
DMINATOR
ok i am new to OpenGL . I am trying to modify lesson10 from tutorials to be able load a texture specified in the file I have 3 sectors: sector1 , sector2 , sector3 typedef struct tagSECTOR { int stexture; // A texture number from texture list int numtriangles; TRIANGLE* triangle; } SECTOR; Each sector is loaded with sector = SetupWorld("data\\world.txt"); However if i try to execute with different order the sector 2 actually looses texture number , but if sector2 is executed at the end than everything is ok I have found that glGenTextures(maxtext, &texture[texnum]); somehow changes only sector2 parameters ,i am really stuck on this one plz help. Here is the link to Visual C++ 6.0 source code http://www.hot.ee/knaint/Lesson10.zip
DMINATOR
DMINATOR
Cmon noone can''t help me ? I couldnot find a solution i tried creating sectors as array and building list , everything works ok but
glGenTextures(3, &texture[texnum]);

somehow changes my hInstance variable to 0x0000009 with texnum = 2 , that''s a weird thing , i don''t know how to solve it.
DMINATOR
DMINATOR
OK i have found a cause, it seems that i have incorrectly accesed glGenTextures(3, &texture[texnum]); - i was trying to create 3 textures from the 1 texture[texnum] , that''s why i got so nasty errors , the solution is to create 1 texture for 1 texture , as it should be

glGenTextures(texnum, &texture[texnum]); So now it works great
Tnx for everyone who hellped me

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.