Archived

This topic is now archived and is closed to further replies.

Mulligan

Shot in the dark texture question

Recommended Posts

Mulligan    378
Im attempting to add texturing to my editor, but the textures ony display in the last window. The same rendering code is used for each of the views. Heres a picture: any idea whats wrong?

Share this post


Link to post
Share on other sites
Sneftel    1788
Are the different views different OpenGL contexts, or different viewports within the same context?


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Do you honestly expect a response? We need WAAAY more info.

Share this post


Link to post
Share on other sites
Mulligan    378
When i disable the bottom three views, the top view becomes textured. So basically, whichever view is rendered last works properly.

Im almost sure its just an order of operations issue with opengl commands, because i have solved this problem before, but i cant recall how.

Share this post


Link to post
Share on other sites
Sneftel    1788
Are you calling glBindTexture and glTexImage2D in each context?


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
Mulligan    378
Ahha, i tried switching the context when generating textures and low and behold, they only appear in the active context when the texture was generated.

So, do i seriously have to generate 4 of the same textures for to allow texturing in all four windows at once? Seems like overkill...

also, are how do i free the textures from memory? my setup maintains a single list of unsigned ints, which represent pengl textures, but does it matter which context is enabled when i free them?


thanks Sneftel, you were quite right

[edited by - Mulligan on January 25, 2004 3:49:36 PM]

Share this post


Link to post
Share on other sites
Mulligan    378
sounds like what i need, but it doesnt exist in my version of opengl and info on it al almost nonexistant.

glShareLists( m_library_viewRC, m_hMemRC)

which header file defines it?

Share this post


Link to post
Share on other sites
iNsAn1tY    476
Hi Mulligan, good to see the editor's going well. I had this problem (yup, my editor's still in development too), and the best way to do it seems to be to create a master rendering context for your main window, load all your textures into that, then create the child windows and their child rendering contexts, and link each one to the master rendering context with a call to wglShareLists. This way, the textures aren't tied to any particular child window, and you can change them easily. Your editor's based on UnrealEd, right?


Windows 95 - 32 bit extensions and a graphical shell for a 16 bit patch
to an 8 bit operating system originally coded for a 4 bit microprocessor,
written by a 2 bit company that can't stand 1 bit of competition.


[edited by - iNsAn1tY on January 25, 2004 4:53:09 PM]

Share this post


Link to post
Share on other sites