Hi everyone,
I've created a program that uses threads to process the images and points (which are centers of cubes)
I would add a low priory thread that uses OpenGL functions to draw the cubes as they have them processed, through the centre and size, using "wiredCube"...I'm just not very good with OpenGL, but I have read various articles here and looking on google: all the examples I find are with "mainloop" in the main, in charge of launching the various drawing functions of OpenGL...
Instead, how can I do to have a simple function of three-dimensional design, which is updated every few time, with the cubes refreshing, with just a simple thread?
I'm on Visual C++ and a 64bit app. I've read that I need freeglut to use 64bit libs...
Please, someone could show me how?
A piece of code of my program is this:
#include <windows.h>
#include <process.h>
....
variables, others..
int main(){
HANDLE handle0,handle1,handle2,handle3,handle4;
handle0 = (HANDLE) _beginthread(puts,0,&dati0);
handle1 = (HANDLE) _beginthread(grey,0,&dati1);
handle2 = (HANDLE) _beginthread(soglia,0,&dati2);
handle3 = (HANDLE) _beginthread(finitura,0,&dati3);
handle4 = (HANDLE) _beginthread(verifica,0,&dati4);
WaitForSingleObject(handle0,INFINITE);
WaitForSingleObject(handle1,INFINITE);
WaitForSingleObject(handle2,INFINITE);
WaitForSingleObject(handle3,INFINITE);
WaitForSingleObject(handle4,INFINITE);
..other code...
...
}
I need to insert a "fifth" thread that do 3D drawing, in low priority (background)...
Please, help me.