64-bit Ubuntu with Code::Blocks IDE configuration OpenGL development Environment

Source: Internet
Author: User

Http://jingyan.baidu.com/article/c74d60007d104f0f6b595d6d.html

Sample program:

#include <GL/glut.h>#include<stdlib.h>voidinit ();voiddisplay ();intMainintargcChar*argv[]) {Glutinit (&argc, argv); Glutinitdisplaymode (Glut_rgb|glut_single); Glutinitwindowposition (0,0); Glutinitwindowsize ( -, -); Glutcreatewindow ("OpenGL 3D View");    Init ();    Glutdisplayfunc (display);    Glutmainloop (); return 0;}voidinit () {Glclearcolor (0.0,0.0,0.0,0.0);    Glmatrixmode (gl_projection); Glortho (-5,5, -5,5,5, the);    Glmatrixmode (Gl_modelview); Glulookat (0,0,Ten,0,0,0,0,1,0);}voiddisplay () {glclear (gl_color_buffer_bit); glcolor3f (1.0,0,0); Glutwireteapot (3); Glflush ();}

Effect:

Note: project development

When developing, create new glut project, write code in Main.cpp
When you are new, you have an example from OpenGL

64-bit Ubuntu with Code::Blocks IDE configuration OpenGL development Environment

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.