• Advertisement

Archived

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

Shot in the dark texture question

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

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
Advertisement
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
Do you honestly expect a response? We need WAAAY more info.

Share this post


Link to post
Share on other sites
I *think* that each context keeps up with its own textures, so you cannot use textures from one context in another. BTW, nice editor, and good luck.

Share this post


Link to post
Share on other sites
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
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
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
look up glShareLists() on MSDN, it allows contexts to share display lists and textures.

Share this post


Link to post
Share on other sites
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
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
Ahha, thanks. This is actually the second version of this editor, i decided to re-do it so that it would be stable this time.

Share this post


Link to post
Share on other sites

  • Advertisement