LWJGL Forum

Programming => OpenGL => Topic started by: mrumpf on March 07, 2006, 15:21:21

Title: Scrollable canvas
Post by: mrumpf on March 07, 2006, 15:21:21
I am new to OpenGl and have a few problems:

I am writing an application with a large 2D-canvas and a non-standard scrollbar. I found out that I can scroll the canvas with the translated/f command. However, the graphical display is flickering while scrolling.

1. Is this the best way to implement something like a viewport for scrolling?

2. How can I stop the flickering?

3. How do the coordinates for the translation-command correspond with the pixel coordinates on my screen?

Thank you in advance,
Mike
Title: Scrollable canvas
Post by: TalanOFF on March 09, 2006, 12:41:33
I'm pretty new to the whole OpenGL stuff but I fixed my flickering issues by using double buffering.

While the front one is beeing drawn the back buffer is beeing filled. After you've performed single drawing of a frame just flip the buffers by calling (whatever method your canvas provides for it) canvas.swapBuffers() (for the GLCanvas in SWT 3.2).

If you already use double buffering make sure not to flip buffers twice.

Oh, what graphics library do you use? Swing/AWT/SWT or other?

Signed: TalanOFF
Title: Scrollable canvas
Post by: mrumpf on March 14, 2006, 16:45:13
@TalanOFF

I am using the SWT library 3.2