Linux live CD with OpenGL development tools

Trying to find find gl, glu, & glut

Page 1 of 1

5 Replies - 1309 Views - Last Post: 05 March 2008 - 09:03 PM

#1 ericode  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 112
  • Joined: 09-December 06

Linux live CD with OpenGL development tools

Posted 02 March 2008 - 07:45 PM

I've been searching for a Linux distribution (on a live cd) with support for OpenGL development in C/C++ (other languages would be nice as well). Any distros come to mind?

I've been using this simple program and make file to test if the gl, glu, and glut libraries are present (by just trying to make).

main.cpp
#ifndef MAIN_CPP
#define MAIN_CPP

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <iostream>

using std::cout;



void init()
{
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glEnable(GL_DEPTH_TEST);
}

void renderScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


	glBegin(GL_LINES);
		glVertex3f(0.0, 0.0, 0.0);
		glVertex3f(0.0, 1.0, 0.0);

	glEnd();




	glutSwapBuffers();

}

void keyboardfunc(unsigned char c, int x, int y)
{
	switch (c)
	{
		case 't':
			glRotatef(4.0, 0.0, 0.0, 1.0);
			break;
		case 'y':
			glRotatef(-4.0, 0.0, 0.0, 1.0);
			break;



		case 'u':
			glRotatef(4.0, 0.0, 1.0, 0.0);
			break;
		case 'i':
			glRotatef(-4.0, 0.0, 1.0, 0.0);
			break;



		case 'o':
			glRotatef(4.0, 1.0, 0.0, 0.0);
			break;
		case 'p':
			glRotatef(-4.0, 1.0, 0.0, 0.0);
			break;



		case 'w':
			glTranslatef(0.0, 1.0, 0.0);
			break;
		case 'a':
			glTranslatef(-1.0, 0.0, 0.0);
			break;
		case 's':
			glTranslatef(0.0, -1.0, 0.0);
		case 'd':
			glTranslatef(1.0, 0.0, 0.0);
			break;


	}
	renderScene();
}



void changeSize(int w, int h)
{
	//currentWindowWidth = w;
	//currentWindowHeight = h;

	float angle=0.0;
	float x=0.0f,y=1.75f,z=5.0f;
	float lx=0.0f,ly=0.0f,lz=-1.0f;
	float ratio=1.0;

	// Prevent a divide by zero, when window is too short
	// (you cant make a window of zero width).
	if(h == 0)
		h = 1;

	ratio = 1.0f * w / h;
	// Reset the coordinate system before modifying
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();

	// Set the viewport to be the entire window
	glViewport(0, 0, w, h);

	// Set the clipping volume
	gluPerspective(45,ratio,1,1000);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(x, y, z,
			  x + lx,y + ly,z + lz,
			  0.0f,1.0f,0.0f);
}


int main(int argc, char **argv)
{
	cout << "In main()\n";
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
	glutInitWindowPosition(100,100);
	glutInitWindowSize(300,300);
	glutCreateWindow("simple beginning");

	init();

	glutKeyboardFunc(keyboardfunc);
	//glutMouseFunc(mousefunc);

	glutDisplayFunc(renderScene);
	//glutIdleFunc(renderScene);
	glutReshapeFunc(changeSize);


	glutMainLoop();

	return(0);
}

#endif




Makefile
INCLUDE = -I/usr/X11R6/include/ 
LIBDIR  = -L/usr/X11R6/lib -L/usr/lib

COMPILERFLAGS = -Wall
CC = g++
CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
LIBRARIES = -lX11 -lXi -lglut -lGL -lGLU -lm

All: main

main: main.o

	$(CC) $(CFLAGS) -o $@ $(LIBDIR) $< $(LIBRARIES)





Is This A Good Question/Topic? 0
  • +

Replies To: Linux live CD with OpenGL development tools

#2 GWatt  Icon User is offline

  • member icon

Reputation: 278
  • View blog
  • Posts: 3,079
  • Joined: 01-December 05

Re: Linux live CD with OpenGL development tools

Posted 02 March 2008 - 08:44 PM

You could just try locate gl.h Although I don't know if most live linux distros ship with many developer libraries. Usually you install linux and can then download anything you need.
Was This Post Helpful? 0
  • +
  • -

#3 MorphiusFaydal  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,376
  • Joined: 12-May 05

Re: Linux live CD with OpenGL development tools

Posted 02 March 2008 - 09:20 PM

Ubuntu LiveCD might work. $ sudo apt-get install build-essential to install things like GCC, make, autoconf, etc.
Was This Post Helpful? 0
  • +
  • -

#4 ericode  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 112
  • Joined: 09-December 06

Re: Linux live CD with OpenGL development tools

Posted 03 March 2008 - 11:30 AM

View PostMorphiusFaydal, on 2 Mar, 2008 - 09:20 PM, said:

Ubuntu LiveCD might work. $ sudo apt-get install build-essential to install things like GCC, make, autoconf, etc.


I'm trying to find something that would work without needing to download the libraries. I might try making my own live CD (just by including these libraries in an existing one...not sure on how to do that yet though) if I can't find one that works.
Was This Post Helpful? 0
  • +
  • -

#5 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Linux live CD with OpenGL development tools

Posted 03 March 2008 - 11:41 AM

View PostGWatt, on 2 Mar, 2008 - 08:44 PM, said:

You could just try locate gl.h Although I don't know if most live linux distros ship with many developer libraries. Usually you install linux and can then download anything you need.

Most livecd's don't ship with an updated slocate database, so that probably wouldn't work without running "sudo updatedb" first.

--------------

I think Slax lets you add packages (from their site) like GCC to the iso pretty easily. Might be worth a look. :^:
Was This Post Helpful? 0
  • +
  • -

#6 ericode  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 112
  • Joined: 09-December 06

Re: Linux live CD with OpenGL development tools

Posted 05 March 2008 - 09:03 PM

View PostTom9729, on 3 Mar, 2008 - 11:41 AM, said:

View PostGWatt, on 2 Mar, 2008 - 08:44 PM, said:

You could just try locate gl.h Although I don't know if most live linux distros ship with many developer libraries. Usually you install linux and can then download anything you need.

Most livecd's don't ship with an updated slocate database, so that probably wouldn't work without running "sudo updatedb" first.

--------------

I think Slax lets you add packages (from their site) like GCC to the iso pretty easily. Might be worth a look. :^:


Wow! I'm really impressed with Slax just from reading some about it. I'm downloading it right now and I'll play around with updating the iso before burning it. Thanks for the tip.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1