ubuntu下code::blocks+opengl的使用与配置

操作系统:Ubuntu 15.04

gcc version 4.9.2

opengl安装

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

测试:

  1. include <GL/glut.h>
  2. void init(void)
  3. {
  4. glClearColor(0.0, 0.0, 0.0,
    0.0);
  5. glMatrixMode(GL_PROJECTION);
  6. glOrtho(-5, 5,
    -5, 5, 5, 15);
  7. glMatrixMode(GL_MODELVIEW);
  8. gluLookAt(0, 0, 10, 0, 0, 0,
    0, 1, 0);
  9. return;
  10. }
  11. void display(void)
  12. {
  13. glClear(GL_COLOR_BUFFER_BIT);
  14. glColor3f(1.0, 0, 0);
  15. glutWireTeapot(3);
  16. glFlush();
  17. return;
  18. }
  19. int main(int argc, char
    *argv[])
  20. {
  21. glutInit(&argc, argv);
  22. glutInitDisplayMode(GLUT_RGB
    | GLUT_SINGLE);
  23. glutInitWindowPosition(0, 0);
  24. glutInitWindowSize(300, 300);
  25. glutCreateWindow("OpenGL 3D View");
  26. init();
  27. glutDisplayFunc(display);
  28. glutMainLoop();
  29. return 0;
  30. }

保存为test.c并执行

gcc -o test test.c -lGL -lGLU -lglut
./test

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAFICAYAAADqGMM5AAAABHNCSVQICAgIfAhkiAAAIABJREFUeF7tfQm0JEWZ7l91q+5+e9+bpptmk0agZWkRaEFQAXVEGJfj8zmMyvMpehyf6Igyo86cEcdlnHd8jmecGeeNiu+p4/O4oLQgYtOtIDTIvkPTG3B7vftW2/uj7o3u6LiRkZlVmVkVlV/2qVOZEX/88f/f/8eXkZFRtzMrV66o0MyxcvlSWrpsEfX0dssifAMBIAAEGoLA6MgY7dnzEvX375/pP0O5XFsbtbXl6NR1J1Df3B7KV6/bGmIgOgUCQAAISATa8znq7eumFSuW0WOPPU3FYokya9euqaxbdxItmN9HGf5XLJWoXD486QJ6QAAIAIGGINDWliUxoZoqFGhoeIwee/Qpyi1fvoT6eruqJFUsFhti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PNwGAi4iAMJyMWqwGQikFAEQVkoDD7eBgIsIgLBcjBpsBgIpRQCEldLAw20g4CICICwXowabgUBKEQBhpTTwcBsIuIgACMvFqMFmIJBSBEBYKQ083AYCLiIAwnIxarAZCKQUARBWSgMPt4GAiwiAsFyMGmwGAilFAISV0sDDbSDgIgIgLBejBpuBQEoRAGGlNPBwGwi4iAAIy8WowWYgkFIEQFgpDTzcBgIuIgDCcjFqsBkIpBQBEFZKAw+3gYCLCICwXIwabAYCKUUAhJXSwMNtIOAiAiAsF6MGm4FAShEAYaU08HAbCLiIAAjLxajBZiCQUgRAWCkNPNwGAi4iAMJyMWqwGQikFAEQVkoDD7eBgIsIgLBcjBpsBgIpRQCEldLAw20g4CICICwXowabgUBKEQBhpTTwcBsIuIgACMvFqMFmIJBSBEBYKQ083AYCLiIAwnIxarAZCKQUARBWSgMPt4GAiwiAsFyMGmwGAilFAISV0sDDbSDgIgIgLBejBpuBQEoRAGGlNPBwGwi4iAAIy8WowWYgkFIEQFgpDTzcBgIuIgDCcjFqsBkIpBQBEFZKAw+3gYCLCPx/ZvcavWdNR/AAAAAASUVORK5CYII=" alt="" />

安装codebelocks:

$ sudo apt-get install codeblocks

设置编译器

【Settings】->Compiler..选择GUN GCC Compiler

设置opengl库路径

【Settings】->Compiler..选择Linker settings -> Link libraries并添加

/usr/lib/libglut.so
/usr/lib/libGLU.so
/usr/lib/libGL.so

拷贝相应的库到/usr/lib/内

$ sudo cp /usr/lib/i386-linux-gnu/libglut.so /usr/lib/libglut.so
$ sudo cp /usr/lib/i386-linux-gnu/libGLU.so /usr/lib/libGLU.so
$ sudo cp /usr/lib/i386-linux-gnu/mesa/libGL.so /usr/lib/libGL.so

设置codeblocks的界面风格
关闭codeblocks软件,打开~/.codeblocks/default.conf

打开连接 传送门复制连接后面的代码到~/.codeblocks/default.conf,并保存。在复制之前可以先备份一下次文件

打开【Settings】->Editor,点击左侧Syntax highlighting,选择Color theme为 vim (当然也可以选择其他主题,这里的主题都很不错)

由于这些主题中,都没有光标(其实是光标的颜色跟背景色相同了),需要设置下光标

打开【Settings】->Editor,点击左侧Margins and caret ,选择Caret 中的Style 为Line,Width为3 ,Color为红色(这些参数可以根据自己喜好选择,主要是颜色不能和背景色一样,要不然会找不到光标)

上一篇:[更新]单线程的JS引擎与 Event Loop


下一篇:云笔记项目-Spring事务学习-传播Requried