LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2010, 06:17 PM   #1
fpsasm
LQ Newbie
 
Registered: Feb 2010
Location: UK, Leeds
Distribution: PCLinuxOS, Fedora Core, SuSE,ubuntu
Posts: 20

Rep: Reputation: 1
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
 
Old 03-17-2010, 06:53 PM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
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();
 
Old 03-18-2010, 07:25 AM   #3
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
^^ 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenGl programming ankit_mcgill Linux - Newbie 1 09-12-2008 06:34 PM
linux graphics programming using C++ with openGL hyjalsoul Programming 2 04-21-2008 01:06 PM
Linux graphics programming using C++ with openGL hyjalsoul Ubuntu 2 04-21-2008 01:05 PM
opengl window not having title bar-using freeglut for opengl programming in c++ ashjas Fedora 0 01-19-2008 02:46 AM
OpenGL programming koyi Programming 10 04-22-2004 07:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration