LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   OpenGL (C LInux) programming (https://www.linuxquestions.org/questions/programming-9/opengl-c-linux-programming-796142/)

fpsasm 03-17-2010 06:17 PM

OpenGL (C LInux) programming
 
Hello, I am trying to plot some points using OpenGL. I want to do something like:


increase x coord (from pixel 0 -> 1000)[
increase y coord (from pixel 0 -> 1000)[
do something (calculate)
if something = 0
plot point (blue)
if something = 1
plot point (white)
]
]

Thanks in advance for the help..
Cheers,
Matthew M

troop 03-17-2010 06:53 PM

Code:

x=1000; y=1000;
if (!something) glColor3f(0.,0.,1.);
else if(something == 1) glColor3f(1.,1.,1.);
glBegin(GL_POINTS);
glVertex2f(x, y);
glEnd();


devnull10 03-18-2010 07:25 AM

^^ It sounds to me like he wants it in a loop to look through every pixel rather than just the pixel at 1000,1000. If that is the case then the OP will need two loops, nested.


All times are GMT -5. The time now is 03:45 PM.