PDA

View Full Version : Setting up OpenGL



10-20-2003, 09:30 AM
I programm under Borland C++ Builder 6.0 and need to set up OpenGL for rendering in a TPicture component. How can I do this? I do correctly under a whole window dedicated for OpenGL even in a component such as TPanel and TButton but I like it to be a TPaintBox (that'd perfect). HELP!!!!

By the way, how can I configure Outlook for reading this forum in it? I need the server.

thx a lot.

yaro_dup1
10-21-2003, 04:56 AM
What's the difference which component you use?
Every of them has unique hWnd (called handle) and this is only the one parameter you need to setup OpenGL.

10-22-2003, 09:49 AM
Sorry, I meant I wanted to use the TPaintBox component (the one with a painter's brush in it).

My question is: how can I initialize OpenGL for rendering in it? I can set it up for rendering in a TPanel component, but I'd like it to be a TPaintBox component.

Thx

chowe6685
10-22-2003, 11:50 AM
errr, he told you how. All you need to set up an opengl window is the hWnd, just use the one from the TPaintBox instead of the windows handle. If you are using GLFW or GLUT you may have to switch to a windows api based approach. This isn't hard but is long, see nehe.gamedev.net for details.

Zengar
10-22-2003, 12:08 PM
I don't know how it is in Builder, but in Delphi TPicture is a non-window control. It means - it has no window handle(it uses owners handle instead). If it also applies to Builder, well... sorry for you. You could develop an own component, however.

10-24-2003, 04:36 AM
The simplest way is to render the GL scene to a bitmap and then render the bipmap into the controls canvas.

10-24-2003, 10:51 AM
chowe6685: the TPaintBox component has no window handle but some other type so I can't do what you do.

OLI-G: I can't render in an image because that's the question of my post.

HELP!!!!!!!!!!!!

yaro_dup1
10-24-2003, 11:55 AM
I don't get it, why can't you make it with simple TPanel?

10-24-2003, 03:35 PM
Because I have everything in a TPaintBox component but without using OpenGL. If I keep that component I'll have to change fewer things.

Does anybody know if what I'm trying to do is posible?

Rendering to a TPanel would work if I could copy its canvas to the TPaintBox. I use the Draw method of the canvas which accepts no TCanvas for the source.

HELP!!!!