2013年9月3日 星期二

Vmware+Ubuntu+wxWidgets-2.8.11+sqlite3-3.6.22+wxsqlite3+openGl

ref. http://converse-2008.blogspot.com/2010/09/how-to-building-opengl-in-ubuntu.html

apt-get install build-essential
apt-get install libgl1-mesa-dev
apt-get install libglu1-mesa-dev
apt-get install freeglut3-dev

In example.c


#include

void init();
void display();

int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);

glutCreateWindow("OpenGL 3D View");

init();
glutDisplayFunc(display);

glutMainLoop();
return 0;
}

void init()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glOrtho(-5, 5, -5, 5, 5, 15);
glMatrixMode(GL_MODELVIEW);
gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
}

void display()
{
glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1.0, 0, 0);
glutWireTeapot(3);

glFlush();
}

gcc example.c -o example.out -lGL -lGLU -lglut
./example.out


////////////////////////////////////////////////////////////////////////////
//sqlite3_3.6.22.orig.tar.gz put in /home

make clean

export PREFIX=/usr/wxbuild
export CFLAGS="-I$PREFIX/include"
export CPPFLAGS="-I$PREFIX/include"
export CXXFLAGS="-I$PREFIX/include"
export LDFLAGS=-L$PREFIX/lib
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

./configure --prefix=$PREFIX --disable-shared

make

make install

//////////////////////////////////////////////////////////////////////////////
//http://wiki.wxwidgets.org/Cygwin
//wxWidgets-2.8.11.tar.gz put in /home

make clean

export PREFIX=/usr/wxbuild
export CFLAGS="-I$PREFIX/include"
export CPPFLAGS="-I$PREFIX/include"
export CXXFLAGS="-I$PREFIX/include"
export LDFLAGS=-L$PREFIX/lib
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

./configure --prefix=$PREFIX --disable-shared --with-gtk --enable-unicode --enable-std_iostreams --with-opengl

make
make install
make samples

////////////////////////////////////////////////////////////////////////////
//wxsqlite3-1.9.9.tar.gz extract in /wxWidgets-2.8.11

cd wxsqlite3-1.9.9

make clean

export PREFIX=/usr/wxbuild
export CFLAGS="-I$PREFIX/include"
export CPPFLAGS="-I$PREFIX/include"
export CXXFLAGS="-I$PREFIX/include"
export LDFLAGS=-L$PREFIX/lib
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

./configure --prefix=$PREFIX --with-wx-config=/usr/wxlib/lib/wx/config/gtk2-unicode-release-static-2.8 --disable-shared --enable-unicode

make

make install

沒有留言:

張貼留言