Ubuntu13.04 use Mesa

Source: Internet
Author: User
Tags netbeans
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.