• Advertisement
Sign in to follow this  

2 program 1 opengl window

This topic is 4430 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 ! I have a opengl question : My first opengl (win) create the window and OpenGl context. Can I use this window and context from my second opengl program ???? ( second program not create window , only want use existing window and context ) Sorry my bad english ! THX playsoft

Share this post


Link to post
Share on other sites
Advertisement
every window has a handle HWND , if you get that handle you can Resize,move,close,maxmize etc.. , but if you want to access the OpenGL context/device you will have to register some window's msgs , and then send that msg to the OpenGL window from the other window and write what ever code triggers on reciving that msg , but again i have no idea why would you wanna do this , if your trying to make some cool moves like making a charechtar jump from one window to the other there are some documentation on that stuff you should Google it.
Hope that helps.

Share this post


Link to post
Share on other sites
If your talking about merely reusing the code for creating a window for your second project, then most definately.

Share this post


Link to post
Share on other sites
Opps , I have 2 acc :) ( i'm playsoftH )

I write slot machine programs.

My first app is game selector exe, this proggy make Windows window and OpenGL context.

Second apps is a game. Now game create too new window and opengl context.

And when is this possible, I want use first game selector appz window/opengl context in game appz, not another window.

THX.

playsoft



Share this post


Link to post
Share on other sites
Why not just make an game engine that also allows you to select the games. Select the game and branch off to that code. No need for multiple game engines or writing code 2x or more.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement