Ubuntu13.04 use Mesa
Last Update:2014-05-15
Source: Internet
Author: User
Ubuntu13.04 use Mesa first install: [cpp] sudoapt-getinstalllibgl1-mesa-devsudoapt-getinstalllibglu1-mesa-devsudoapt-getinstallfreeglut3-dev now don't use NetBeans, use CMake to create a job Ubuntu13.04 use Mesa first install: [cpp] sudo apt-get install libgl1-mesa-dev sudo apt-get install libglu1-mesa-dev sudo apt-get install freeglut3-dev now no longer using NetBeans, use CMake to create a project. Contents: [cpp] cmake_minimum_required (VERSION 2.8) project (vender) add_subdirectory (src bin) contents: [cpp] cmake_minimum_required (VERSION 2.8) set (CMAKE_BUILD_TYPE Debug) set (PROJECT_INCLUDE_DIR .. /include) include_directories ($ {PROJECT_INCLUDE_DIR}) AUX_SOURCE_DIRECTORY ($ {CMAKE_SOURCE_DIR}/src CPP_LIST1) add_executable (vender $ {CPP_LIST1}) target_link_libraries (ve Nder gl glu glut) add_definitions (-Wall) then let's take a look at the src/main. cc file content, which is the same as the code three years ago. [Cpp] # include Void init (); void display (); int main (int argc, char * argv []) {gluinit (& argc, argv); gluinitdisplaymode (glu_rgb | glu_single ); gluinitwindowposition (0, 0); gluinitwindowsize (300,300); glucreatewindow ("OpenGL 3D View"); init (); gludisplayfunc (display); glumainloop (); return 0 ;} void init () {glClearColor (0.0, 0.0, 0.0, 0.0); glMatrixMode (GL_PROJECTION); glOrtho (-5, 5,-5, 5, 5, 15); glMa TrixMode (GL_MODELVIEW); gluLookAt (0, 0, 10, 0, 0, 0, 0, 1, 0);} void display () {glClear (GL_COLOR_BUFFER_BIT ); glColor3f (1.0, 0, 0); gluwireteapot (3); glFlush ();} running result: I don't want to draw any graphics this time, just want to know my graphics type. Therefore, the code is deleted as follows: [cpp] # include # Include Using namespace std; int main (int argc, char * argv []) {gluinit (& argc, argv); gluinitdisplaymode (glu_rgb | glu_single); gluinitwindowposition (0, 0 ); gluinitwindowsize (300,300); glucreatewindow ("OpenGL 3D View"); GLubyte const * vender = glGetString (GL_VENDOR); cout <"GL_VENDOR:" <vender <endl; GLubyte const * renderer = glGetString (GL_RENDERER); cout <"GL_RENDERER:" <renderer <e Ndl; GLubyte const * version = glGetString (GL_VERSION); cout <"GL_VERSION:" <version <endl; return 0;} running result: [cpp] dean @ dean-GA-MA790XT-UD4P: ~ /Work/opengl/vendor/build/bin $./vender GL_VENDOR: X. Org GL_RENDERER: Gallium 0.4 on amd juniper GL_VERSION: 3.0 Mesa 9.1.4