 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nikumaru Guest
|
Posted: Thu Jun 26, 2003 5:30 pm Post subject: Re: OpenGL Problem |
|
|
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
|
Posted: Wed Jul 02, 2003 10:38 am Post subject: Re: OpenGL Problem |
|
|
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
|
Posted: Wed Jul 02, 2003 11:38 am Post subject: Re: OpenGL Problem |
|
|
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
|
Posted: Mon Sep 01, 2003 2:38 pm Post subject: Re: OpenGL Problem |
|
|
"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(" ~ 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 |
|
 |
Alen Markov Guest
|
Posted: Sun Nov 30, 2003 4:02 pm Post subject: Re: OpenGL Problem |
|
|
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(" ~ 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 |
|
 |
|
|
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
|
|