Sorry for new thread but other thread was getting off topic....
I installed glut as like the readme.txt file said:
* Put the .dll in system32 directory
* put the .h file in "CodeBlocks\MinGW\include" and "CodeBlocks\MinGW\include\GL"
* put the .lib "CodeBlocks\MinGW\lib"
Restarted program and the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/* Using the standard output for fprintf */
#include <stdio.h>
#include <stdlib.h>
/* Use glew.h instead of gl.h to get all the GL prototypes declared */
#include <glew.h>
/* Using the GLUT library for the base windowing setup */
#include <glut.h>
/* ADD GLOBAL VARIABLES HERE LATER */
int init_resources(void)
{
/* FILLED IN LATER */
return 1;
}
void onDisplay()
{
/* FILLED IN LATER */
}
void free_resources()
{
/* FILLED IN LATER */
}
int main(int argc, char* argv[])
{
/* Glut-related initialising functions */
glutInit(&argc, argv);
glutInitContextVersion(2,0);
glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH);
glutInitWindowSize(640, 480);
glutCreateWindow("My First Triangle");
/* Extension wrangler initialising */
GLenum glew_status = glewInit();
if (glew_status != GLEW_OK)
{
fprintf(stderr, "Error: %s\n", glewGetErrorString(glew_status));
return EXIT_FAILURE;
}
/* When all init functions run without errors,
the program can initialise the resources */
if (1 == init_resources())
{
/* We can display it if everything goes OK */
glutDisplayFunc(onDisplay);
glutMainLoop();
}
/* If the program exits in the usual way,
free resources and exit with a success */
free_resources();
return EXIT_SUCCESS;
}
|
... does not work and gives errors:
http://imgur.com/H2R00O9
I would really like to know:
* If there is any way to simply copy and paste build errors like normal text, and if not, why the hell not?
* If the code I quoted above actually does work or not. (its from:
http://en.wikibooks.org/wiki/OpenGL_Programming#The_basics_arc)
* If none of the above, what have the install instructions not said how to do?