Jump to content
  • Advertisement

Archived

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

Shawn54c

Multiple OGL instances, texture issues

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

Hi, my problem is rather complicated so ill do my best to describe the issue im having. We have a windows application that contains multiple "pages" ( mainframe windows ) with childframes inside of them, the child frames are then divided into splitterwnd's. this allows us to put activex controls inside each page ( any number of them ). so here is the problem. i have a 3d plotter that uses opengl . it is it's own activex control so you can plop several of them on the screen at once. what happens is when we have multiple plotters instatiated in the program and we reevaluate the file to be plotted weird things with the textures start to happen. if i have 2 different measurements (flatness and fit) and say i have 3 plotters on the screen, 2 are displaying flatness and one is displaying fit, when i reevaluate the file the ones for flatness are displaying the texture for the fit plot, and vice versa for the fit plot. it could also happen that the texture doesnt get set at all and the plot is just a shape with a matte grey on it. Then if you go to an individual plot and configure it ( modify things like scale etc, but you dont even have to change anything ) when it redraws it on configure the plot then shows the correct texture. the refreshing for the reevaluate and the configure call the same block of code to create all the necessary stuff. what im doing is generating the data set for the points from a map that is provided, the dataset's are ALWAYS correct. i then take an object that we have and generate the bitmap of the part which will be used as a texture ( we have tested this extensively by putting the bitmap out to a file etc) and the bitmap that is generated is the correct bitmap for that plot. the bitmap is then padded to be an even power of 2 (just for logistics) and then i generate a texture based on that bitmap. it all seems straightforward to me as to the instantiations of it, also i am deleting EVERYTHING and using new on everything before i redraw (slow but it needs to be done). but what seems to be happening is the plots are getting confused with the textures, it is as if they are swapping their memory. im storing each texture in a GLuint texture[1] by calling the following: if( texturesGenerated ) { glDeleteTextures( 1, texture ); } texturesGenerated = FALSE; glGenTextures(1, texture); // Create The Texture // Typical Texture Generation Using Data From The Bitmap glBindTexture(GL_TEXTURE_2D, texture[0]); // Generate The Texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_Pow2SizedBitmap->bmWidth, m_Pow2SizedBitmap->bmHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, m_Pow2SizedBitmap->bmBits); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR); // Linear Filtering glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering texturesGenerated = TRUE; glBindTexture( GL_TEXTURE_2D, 0 ); im asking if anyone has any idea of why this is happening.. are the multiple instances of opengl only able to support one texture list and therefore it is getting confused? im totally stumped here and so is my boss. we have tracked this down to the texture issue since i used to color the map using a mathematical formula and set each data point to the color based on height (the bitmap generated is done the same way). but i went back to an earlier version before the textures and it always displays the correct information. help would be greatly appreciated -shawn [edited by - shawn54c on June 17, 2003 10:17:01 AM]

Share this post


Link to post
Share on other sites
Advertisement
Im not sure if I can be much help here...and your question is quite specific to your implementation. I am writing a MDI application with multiple OpenGL windows myself so I am aware of issues with using the same texture in multiple windows. I solved my problem by making texturing class that creates the texture as an object, thereby allowing me to use the same texture in multiple windows. If your interested I could post it for you...but I don''t have it with me (Im at work...don''t tell my boss!) ...If your interested I could do it when I get home... Check out my website and email me back...
www.lanceusa.com

Check out: www.lanceusa.com Link

Share this post


Link to post
Share on other sites
thanks for a little bit of insight, except what im running into is i want each window pane to create it''s own texture and use that. it seems that somehow the textures are getting ''shared'' among multiple windows when it definitely shouldnt be. i know this is a difficult thing, this is my third full day of work trying to get a handle on it

Share this post


Link to post
Share on other sites

  • 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!