C++

Miscellaneous Forums/General Discussion/C++

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I'm using GLUT to write C++ programs with graphical interfaces: http://www.opengl.org/resources/libraries/glut/
It's very easy and short to code with, and it runs on all platforms.
For example a simple GLUT program which creates a window and draws a triangle would look like this:
#include "GL/glut.h"

void Render()
{
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
	glBegin(GL_LINE_LOOP);
	glVertex3f(0,0,0);
	glVertex3f(0,1,0);
	glVertex3f(1,0,0);
	glEnd();
	glutSwapBuffers();
}

int main(int argc, char **argv)
{
	glutInitDisplayMode(GLUT_DEPTH|GLUT_DOUBLE|GLUT_RGBA);
	glutInitWindowPosition(100,100);
	glutInitWindowSize(640,480);
	glutCreateWindow("Window Title");
	glutDisplayFunc(Render);
	glutMainLoop();
	return 0;
}