PDA

View Full Version : OpenGL and CBuilder - annoying problem



raybones
12-29-2003, 11:45 AM
Hi,

I have a certain problem - I would like to do my own 3d objects design program; an editing window is larger than monitor's resolution, so window has a scrollbar. The problem is, when I scroll window - it is being refresh, but not full visible widnow area. Is like that, because window is refreshed first, and scrolled as second, so scrolled area isn't rendered. Does somebody now how to get rid of that problem???

12-30-2003, 12:45 AM
Well I think you will have problems if you try to scroll the OpenGL rendering that way.

Instead, try to override the default canvas behaviour, and send the 'scroll up' & 'scroll down' commands directly to OpenGL with glTranslate. Do not translate the canvas itself, just what it 'sees'.

I may be wrong, but I have never seen any CAD program doing it your way. They often use 'mouse middle button drag' to pan the view for example.

hexa
12-30-2003, 01:24 AM
In C++ Builder 5 TPanel has some problems
with repainting when size is changed.In 6 version it should be ok.
In 5 version use only TForm if you need
to change the size in runtime.

raybones
12-30-2003, 01:52 AM
Originally posted by zbuffer_:
Well I think you will have problems if you try to scroll the OpenGL rendering that way.

Instead, try to override the default canvas behaviour, and send the 'scroll up' & 'scroll down' commands directly to OpenGL with glTranslate. Do not translate the canvas itself, just what it 'sees'.

I may be wrong, but I have never seen any CAD program doing it your way. They often use 'mouse middle button drag' to pan the view for example.

Oh yea, I haven't thought about using glTranslate. I'll try it. Thanks for the tip! http://www.opengl.org/discussion_boards/ubb/smile.gif

raybones
12-30-2003, 02:44 AM
Originally posted by hexa:
In C++ Builder 5 TPanel has some problems
with repainting when size is changed.In 6 version it should be ok.
In 5 version use only TForm if you need
to change the size in runtime.

I actually use BCB 6, and that problem with TPanel is still actual http://www.opengl.org/discussion_boards/ubb/frown.gif But I will try another way - the ZBuffer suggestion. Thanks!




[This message has been edited by raybones (edited 12-30-2003).]