So, I started to learn Open GL a bit in Visual Studio 2010, then when I use some basic command to create a simple 2d graphics, error came out from GL_LINES, same goes to other 2d command except the GL_POINTS.(And I tried 3d command and somehow it worked)
Then I hover to GL_LINES command, and the system says
“define GL_LINES 0x0001”
"Error Expression must have a (pointer-to-)function type.
Anyone can give me some advice ? Would appreciate it a lot.
GL_LINES(as well, as GL_POINTS and many other names with GL_ prefix) is a compile-time constant, declared in OpenGL-headers to pass it as an argument to OpenGL functions. you, or whoever written this code, decided it’s a good idea to declare a function with the same name. it’s declared somewhere outside of source code you’ve posted, but you use it. however, from the standpoint of a programming language and common sense, it is a really stupid idea and it leads to a conflict.
Mmmm… to be fair I am confused :/, do you mean that I should make another file and define it there? I am sorry but I got a hard time understanding what you mean.
EDIT: got it fixed, thanks anyway :).
Read the description of glBegin again and look at some examples.
Your basic syntax is incorrect. Read manual on glVertex too.
You probably don’t need the Push and Pop around the Torus command,