BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: OpenGL Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Nikumaru
Guest





PostPosted: Thu Jun 26, 2003 5:30 pm    Post subject: Re: OpenGL Problem Reply with quote



Hi,

Nothing happens? or some error happens?
Anyway, try using a window control component which is inherited from
TWinControl.
How about this?

Nikumaru

"Matthias Knoke" <Matthias.Knoke (AT) t-online (DOT) de> wrote

Quote:
I have made a small open GL program that is running fine if I draw on
the
Canvas of a TForm. what I want is to draw in a part of the window only
(for
example in the canvas of a TPaintBox), but when I'm using the same
code on
the canvas of the Paiontbox, nothing happens.

Whats wrong ?

Best regards
Matthias




Back to top
Matthias Knoke
Guest





PostPosted: Wed Jul 02, 2003 10:38 am    Post subject: Re: OpenGL Problem Reply with quote



Thanks,
but I don't know a window control that is inherited from TWinControl and
has a Canvas-property to draw on it (Canvas is defined in TCustomForm).

When I'm starting the program that is drawing OpenGL on the Canvas of
TPaintbox nothing happens - I can see an emty grey window only, there are no
error messages and nothing is displayed in the window ...

Matthias

"Nikumaru" <nikumaru2002 (AT) ybb (DOT) ne.jp> schrieb im Newsbeitrag
news:3efb2d1c$2 (AT) newsgroups (DOT) borland.com...
Quote:
Hi,

Nothing happens? or some error happens?
Anyway, try using a window control component which is inherited from
TWinControl.
How about this?

Nikumaru

"Matthias Knoke" <Matthias.Knoke (AT) t-online (DOT) de> wrote in message
news:bde4c0$vpi$03$1 (AT) news (DOT) t-online.com...
I have made a small open GL program that is running fine if I draw on
the
Canvas of a TForm. what I want is to draw in a part of the window only
(for
example in the canvas of a TPaintBox), but when I'm using the same
code on
the canvas of the Paiontbox, nothing happens.

Whats wrong ?

Best regards
Matthias






Back to top
Scott Heiman
Guest





PostPosted: Wed Jul 02, 2003 11:38 am    Post subject: Re: OpenGL Problem Reply with quote



You will find links to several OpenGL components at the bottom of my OpenGL
page. Several of them come with source code. I don't recall any that use
TPaintBox, but I think that at least one uses a TPanel.

Personally, I have never been happy with an OpenGL component that inherits a
control that already has a TCanvas component. I created my own control from
TWinControl. I used the ::GetDC and ::ReleaseDC functions to create and
maintain my own device context. That way I have complete control over the
device context, and complete control over how the OpenGL scene is updated.

Existing controls (that inherit TCustomControl) will update the canvas every
time certain windows events occur. I was never able to create a
'flicker-free' OpenGL component from an existing control. Others have, but
there implementations limit the the update rate of the scene.

--
Regards,
Scott
http://members.cox.net/scottheiman/
(a valid e-mail address can be found on my home page)


Back to top
Olledd
Guest





PostPosted: Mon Sep 01, 2003 2:38 pm    Post subject: Re: OpenGL Problem Reply with quote


"Serdar ARITAN" <serdar.aritan (AT) hacettepe (DOT) edu.tr> wrote:
Quote:
Hi,

I have created an OpenGL application with BCB5 in my old computer for 2
years ago. When I moved the application into my new computer I have got
blank form. Later I have run BCB5 OpenGL demos and I have got
an error message for not retrieving a handle of the display device contex
(below). I wonder anybody come across
this problem before.

GlSkel.cpp

hdc = GetDC(Handle);
SetPixelFormatDescriptor();
hrc = wglCreateContext(hdc);
if(hrc == NULL)
ShowMessage("Smile~ hrc == NULL");

New Computer configuration WinXP Prof. P4 3GHz GeForce4MX 440 with AGP8X

Thanks
Serdar


You may try to change a little of your code:

hdc=GetDC(TForm1->Handle); // replace TForm1 with your Form name


good luck!
Sincerely Olledd
Quote:






Back to top
Alen Markov
Guest





PostPosted: Sun Nov 30, 2003 4:02 pm    Post subject: Re: OpenGL Problem Reply with quote

Serdar,

I had the same problem with my ASUS GeForce2 GTS Gfx-Card.
At the beginning I was using the original ASUS Drivers provided with
the card and the hrc was always NULL.

Later on when I changed to the Detonator Drivers of NVidia,
hrc was not null anymore...

In my case it was a Problem with the Driver for my GFX-Card...

Regards,
Alen

--
WEB: http://www.come.to/nostromo



"Olledd" <Olledd (AT) yahoo (DOT) com.tw> wrote

Quote:

"Serdar ARITAN" <serdar.aritan (AT) hacettepe (DOT) edu.tr> wrote:
Hi,

I have created an OpenGL application with BCB5 in my old computer for 2
years ago. When I moved the application into my new computer I have got
blank form. Later I have run BCB5 OpenGL demos and I have got
an error message for not retrieving a handle of the display device contex
(below). I wonder anybody come across
this problem before.

GlSkel.cpp

hdc = GetDC(Handle);
SetPixelFormatDescriptor();
hrc = wglCreateContext(hdc);
if(hrc == NULL)
ShowMessage("Smile~ hrc == NULL");

New Computer configuration WinXP Prof. P4 3GHz GeForce4MX 440 with AGP8X

Thanks
Serdar


You may try to change a little of your code:

hdc=GetDC(TForm1->Handle); // replace TForm1 with your Form name


good luck!
Sincerely Olledd








Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.