Sign in to follow this  
GogetaX

OpenGL OpenGL On TPanel - Help

Recommended Posts

hey guys, im trying to make an OpenGL engine to work on a TPanel using his handle (HWND) for some reason, i seem cant to get it right, all i see is weirdo bug images on the panel here is how i see it: [img]http://i4.photobucket.com/albums/y144/gogetax1/glengine.jpg[/img] and some explanation/Code: i used a Threading system to register the GL Engine on Panel and im also using ssame thread for the engine loop (cuz i have no other way to make a loop without freeze the app) i did it like that: --------------------- Code ------------------------------ if (PeekMessage(msg, 0, 0, 0, PM_REMOVE)) then begin if msg.message=WM_QUIT then Result := False else begin TranslateMessage(msg); DispatchMessage(msg); end; end; glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer glLoadIdentity(); glFlush; SwapBuffers(h_Dc); --------------------- Code ------------------------------ its Delphi code, but it looks exacrly like any other GL Code, so please help me with that.. thanks.

Share this post


Link to post
Share on other sites
Hmm image looks like encrypted tv stream. You say your using threading, is opengl being initialised in a seperate thread? Are you locking things correctly? What should the image look like?

Share this post


Link to post
Share on other sites
the OpenGL is initialised, it should work, i took the code from my other code i made for window mode and modified it to a thread mode and Panel.

and the image should be black, cuz i didnt draw anything yet..

Share this post


Link to post
Share on other sites
ok i think i solved it!
basicly, the problem was one of my mistakes..
i acsidently puted the PeekMessage commands inside IF that never got riched.. thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this