I am trying to learn OpenGL from a Book called Addison.Wesley.OpenGL.Programming.Guide.7th.Ed
But my question is
Can I write the OpenGL code in devc++ ?
And What should I do So i can Compile it
How should I add library Can anybody give me a reference or step by step info
OpenGL In devc++
Page 1 of 15 Replies - 1651 Views - Last Post: 28 May 2010 - 12:19 AM
Replies To: OpenGL In devc++
#2 Guest_Jake*
Re: OpenGL In devc++
Posted 26 May 2010 - 10:14 PM
This thing actually isnt working I copied it from the book
Addison.Wesley.OpenGL.Programming.Guide.7th.Ed
And trying it I included windows.h and <GL3/gl3.h>
But still not working please help
I don't know i posted it in correct secion or not please check it and move to appropriate
Addison.Wesley.OpenGL.Programming.Guide.7th.Ed
And trying it I included windows.h and <GL3/gl3.h>
But still not working please help
void display(void)
{
/* clear all pixels */
glClear(GL_COLOR_BUFFER_BIT);
/* draw white polygon (rectangle) with corners at
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
*/
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glVertex3f(0.25, 0.75, 0.0);
glEnd();
/* don’t wait!
* start processing buffered OpenGL routines
*/
glFlush();
}
void init(void)
{
/* select clearing (background) color */
glClearColor(0.0, 0.0, 0.0, 0.0);
/* initialize viewing values */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
/*
* Declare initial window size, position, and display mode
* (single buffer and RGBA). Open window with “hello”
* in its title bar. Call initialization routines.
* Register callback function to display graphics.
* Enter main loop and process events.
*/
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(“hello”);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0; /* ISO C requires main to return int. */
}
I don't know i posted it in correct secion or not please check it and move to appropriate
#3
Re: OpenGL In devc++
Posted 26 May 2010 - 10:34 PM
Quote
Can I write the OpenGL code in devc++ ?
Quote
And What should I do So i can Compile it
Quote
How should I add library Can anybody give me a reference or step by step info
Quote
This thing actually isnt working
Please give observations. Without information, we cannot help you.
#4 Guest_jake*
Re: OpenGL In devc++
Posted 26 May 2010 - 10:43 PM
Quote
Define "not working". Do your home lights flicker? Do you see big red words on the screen that says "NOT WORKING"?
Please give observations. Without information, we cannot help you.
Please give observations. Without information, we cannot help you.
Sorry man but i am trying to learn it and this is the first program I entered in Which i actually copied But it isn't giving output It says this not defined that not defined
And i don't even have a tiny bit Of idea bout What OpenGL is so how can i tell u what is the observation?
Can u please tell me anything more about it ? and why it is not working
And one more thing i didn't found any thing about adding library to dev c++ still i am searching
#5
Re: OpenGL In devc++
Posted 27 May 2010 - 03:07 AM
I think you may have started too far into the challenge.
Before you do all this OpenGL stuff you need to master the basics of compiling code, reading and understanding error messages and warning messages.
Until you have these foundations in place you will be knocking yourself out trying to do too much all at once.
Put your current book on the shelf for a couple of months and go get yourself a better book to start with.
Have a read here for a selection to choose from:
http://www.dreaminco...ns-for-c-books/
Before you do all this OpenGL stuff you need to master the basics of compiling code, reading and understanding error messages and warning messages.
Until you have these foundations in place you will be knocking yourself out trying to do too much all at once.
Put your current book on the shelf for a couple of months and go get yourself a better book to start with.
Have a read here for a selection to choose from:
http://www.dreaminco...ns-for-c-books/
#6
Re: OpenGL In devc++
Posted 28 May 2010 - 12:19 AM
Well, do you have GLUT installed? Is that your problem?
Page 1 of 1
|
|

New Topic/Question
Reply
MultiQuote









|