PDA

View Full Version : Simple form with pixel manipulation



Mohsen Jamali
02-15-2012, 09:34 AM
Hi guys,
i'm a c programmer and have not work with opengl at all!
i want to create a 800X600 window that just show some circle and be able to manipulate pixels of the form every milisecond and show the result to the user. there is no interaction between user and form(no click, no dblclick,) it just shows some circles with one color and lines with different pixel colors(each line may have different pixel colors)
also i want to be able to change the coordination system, i mean change it from top-left to the center of the window. could anyone help me do that with some sample code? links? tutorial?
all replies are greatly appreciated.
thanks.

menzel
02-15-2012, 10:58 AM
Beside OpenGL you will need a window toolkit to open an OpenGL context, check if your preferred toolkit (win32, GTK, QT, Cocoa) for your OS has OpenGL samples to begin with.

I guess changing the image every millisecond isn't meant literally? Because you would need a very fast display for that, 60Hz TFTs are more common (70Hz TFTs exist, CRTs can often go to 120Hz).


Tutorials:

http://www.arcsynthesis.org/gltut/
http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html

Mohsen Jamali
02-18-2012, 12:05 AM
Beside OpenGL you will need a window toolkit to open an OpenGL context, check if your preferred toolkit (win32, GTK, QT, Cocoa) for your OS has OpenGL samples to begin with.

don't these toolkits reduce the performance?



I guess changing the image every millisecond isn't meant literally? Because you would need a very fast display for that, 60Hz TFTs are more common (70Hz TFTs exist, CRTs can often go to 120Hz).

i mean every milisecond some pixels change, a line for example, about 300 pixels



Tutorials:

http://www.arcsynthesis.org/gltut/
http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html


good tutorials, thanks.

ZbuffeR
02-18-2012, 04:43 AM
I guess changing the image every millisecond isn't meant literally? Because you would need a very fast display for that, 60Hz TFTs are more common (70Hz TFTs exist, CRTs can often go to 120Hz).

i mean every milisecond some pixels change, a line for example, about 300 pixels

Every millisecond is not possible.
Current LCD screen are 60hz (16.667 ms per frame), 120hz ("3D" screens) cost more (8.333ms).

menzel
02-18-2012, 08:55 AM
don't these toolkits reduce the performance?


Not necessarily. Beside: Cou just can't open an 'raw' OpenGL window with no help of any window toolkit.



i mean every milisecond some pixels change, a line for example, about 300 pixels


You might be able to change a buffer every millisecond, but you will only be possible to display 60 different renderings per second.

Mohsen Jamali
02-18-2012, 12:46 PM
i mean every milisecond some pixels change, a line for example, about 300 pixels


You might be able to change a buffer every millisecond, but you will only be possible to display 60 different renderings per second. [/QUOTE]

I think you are right, i should change the bauffer, do the window toolkits allow direct acceess to buffer?