Search code examples
openglcross-platformtheory

Is OpenGL typed the same regardless of platform?


I'm interested in picking up OpenGL and I know that it is defined as cross-platform. Does this mean that I would type the code the same as I would on Windows, a Mac or Linux?

//example pseudocode to make a circle with a radius of 500 pixels and 5 pixels wide 
createCircle(500,5);

If it is typed the same does this mean that OpenGL has API sets stored for Windows and Mac and based on the platform the program is executed on it calls the appropriate one? If it is not, what is the process that goes on here?


Solution

  • OpenGL will display in the exact same way across platforms. It is also typed the same for each platform. Upon compile time, the API will select the correct platform-dependent code for the right platform to insert into the final executable.