Jump to content
  • Advertisement

Archived

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

xiangping

OpenGL opengl rendering in worker thread

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

I make a component by creating an ATL Object in VC,my component supplys a window in which a terrain is rendered using opengl,the component supports mouse and keyboard input to let you walkthrough the terrain.I render the terrain in "OnTimer" event handler and get a poor FPS,so i decided to create a worker thread and put the opengl rendering code in it then the problem came out. Since i put the textures loading code in the component''s main thread not in the worker thread so when i render the terrain in the worker thread i can''t see the texture effect.That is,you can''t use the textures created in another thread though you can get the texture handle.I was confused that the threads in a process can share the process''s data,but they can''t share opengl state and data,why? I know that if i put the texture loading code in my worker thread then everything will be ok,but the component structure just prevent me from doing it.For details,you can drag the component in your VB form at design time,then at runtime when the form is loading,you tell the component to load textures and terrain data through the Interface the component support.the interface implementing code resides in the main thread and cann''t be put into the worker thread,what can i do? So anyone could give an advice i''ll be very appreciate of it,thx!

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!