Jump to content
  • Advertisement

Archived

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

blakey

OpenGL opengl in a windows environment application

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

of i know how to write openGL to a fullscreen, i know how to write openGL in a window, but i dont know how i can write a windows application with toolbars and buttons in say Builder5 and then have a small window within the application which contains openGL graphics. i would like to make a simple editing suite for a program i''m writing so i want to be able to see the results as i work on the grahpic''s properties. Blakey

Share this post


Link to post
Share on other sites
Advertisement
there is no difference. every window has it''s own device context (HDC) and that''s what you bind the OpenGL rendering context to.

i.e.


hWnd = CreateWindow...
hDC = GetDC(hWnd);
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, hRC);


To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
up

yes but how do i put it on a tile. for example similar to writing a windows application using say builder5 for the interface, which plays an avi file and have edit boxes and buttons on aswell

Share this post


Link to post
Share on other sites
Am I right in thinking English is NOT your mother tongue?

It''s difficult to understand exactly what you''re after. Anything with a device context can be drawn upon using OpenGL - main windows, child windows, popups ... whatever.

If you want a window on a window (child window) look at the CreateWindowEx Windows API function, set the X, Y, Width and Height parameters to the position within the main window, and set the hWndParent parameter to the main window handle ... Use the handle from this new window to create your rendering context.

I hope that answers you''re question


Share this post


Link to post
Share on other sites
firstly - no need to be a fecking smart arse shag, you obviously are not a good enough programmer to understand my question.

secondly it has nothing to do with child windows. an example i can think of as the kind of thing i would like to do is the small window that shows a preview of your screen saver in windows, when you have the "OpenGL 3d text" screensaver on. The opengl is running, but in a tiny square within a windows application.

Share this post


Link to post
Share on other sites
as i said before, you create a window, get the device context and apply a rendering context to the device context. you can 18 windows, all the matters is which one is applied to the current rendering context.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
quote:
Original post by blakey
an example i can think of as the kind of thing i would like to do is the small window that shows a preview of your screen saver in windows, when you have the "OpenGL 3d text" screensaver on. The opengl is running, but in a tiny square within a windows application.



If yourself are a good enough programmer, you'll know that that's a child window. Most controls (even buttons) are also considered windows (yes, you can use GL to draw a button).
You have to intercept the paint message for the control. As to how to do it, well, look at "custom controls" in the docs.

Edited by - Fruny on December 4, 2001 1:33:28 PM

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.

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!