Setting up an OpenGL development environment in ubuntu
1.opening terminal window and entering the apt-get command for the packages:
- sudo apt-get install mesa-common-dev
- sudo apt-get install freeglut3-dev
2.Testing
#include "GL/freeglut.h"
#include "GL/gl.h" /* display function - code from:
http://fly.cc.fer.hr/~unreal/theredbook/chapter01.html
This is the actual usage of the OpenGL library.
The following code is the same for any platform */
void renderFunction()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();
glFlush();
} /* Main method - main entry point of application
the freeglut library does the window creation work for us,
regardless of the platform. */
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(,);
glutInitWindowPosition(,);
glutCreateWindow("OpenGL - First window demo");
glutDisplayFunc(renderFunction);
glutMainLoop();
return ;
}
Setting up an OpenGL development environment in ubuntu的更多相关文章
- Establish the LAMP (Linux+Apache+MySQL+PHP) Development Environment on Ubuntu 14.04 Operating System
######################################################## Step One: Update the software package in yo ...
- [Django] Setting up Django Development Environment in Ubuntu 14.04
1. Python Of course you will need Python. Still Python 2.7 is preferred, however if you would like t ...
- Programming in Go (Golang) – Setting up a Mac OS X Development Environment
http://www.distilnetworks.com/setup-go-golang-ide-for-mac-os-x/#.V1Byrf50yM8 Programming in Go (Gola ...
- storm环境搭建(前言)—— 翻译 Setting Up a Development Environment
Setting Up a Development Environment 搭建storm开发环境所需步骤: Download a Storm release , unpack it, and put ...
- Storm(1) - Setting Up Development Environment
Setting up your development environment 1. download j2se 6 SDK from http://www.oracle.com/technetwor ...
- Install Qualcomm Development Environment
安裝 Android Development Environment http://www.cnblogs.com/youchihwang/p/6645880.html 除了上述還得安裝, sudo ...
- Create A .NET Core Development Environment Using Visual Studio Code
https://www.c-sharpcorner.com/article/create-a-net-core-development-environment-using-visual-studio- ...
- The IBM Blockchain Platform:Installing the development environment
Follow these instructions to obtain the IBM Blockchain Platform: Develop development tools (primaril ...
- 1.3 PROGRAM DEVELOPMENT ENVIRONMENT
1.3 PROGRAM DEVELOPMENT ENVIRONMENT 1.4 WIN32 EXECUTEABLE FILE FORMAT We should also know that compl ...
随机推荐
- 【JD的一人戏】之"小羊踢足球"第一篇
好多次加班后坐的士回家,副驾驶座位后内嵌的显示屏正好在播放一个美食节目,内容就是一个着装怪异的厨子把各种食材分门别类地摆在你面前,然后用小小的锅碗瓢盆慢慢的做出很精致的够一个人吃的分量的各种美食,做好 ...
- 一次SQL Server 10054 Troubleshooting
问题 对某个库新增了一个订阅节点,然后需要把一些应用切到新订阅库,以分散负载.当应用切换后,有一个应用每次启动不到30秒,总是报超时的错误,而error log中又没有任何记录: Timeout ex ...
- fn project 数据库配置
Databases We currently support the following databases and they are passed in via the DB_URL environ ...
- C#如何动态设置屏幕分辨率
C#如何动态设置屏幕分辨率 作者:Learning hard 这篇文章主要为大家详细介绍了C#动态设置屏幕分辨率的方法,我们可以使用Screen类设置屏幕分辨率,感兴趣的小伙伴们可以参考一下 下面就不 ...
- Fiddler的Java抓包
代码处理 System.setProperty("http.proxySet", "true"); System.setProperty("http. ...
- (转)C# Socket简单例子(服务器与客户端通信)
本文转载自:http://blog.csdn.net/andrew_wx/article/details/6629721 这个例子只是简单实现了如何使用 Socket 类实现面向连接的通信. 注意:此 ...
- mac book 华为C8815不能debug
最近遇到一个头疼的问题,华为c8815机器,死活不能在mac下debug,虽然最终是能够debug了,但是走了很多弯路. (1)以为是mac的系统问题,所以重装了系统.为了重装系统,备份资料,用快盘上 ...
- TI技术官方论坛
https://e2echina.ti.com/question_answer/dsp_arm/c6000_dsp/f/32/t/172279
- 【转】wireshark抓包工具详细说明及操作使用
wireshark是非常流行的网络封包分析软件,功能十分强大.可以截取各种网络封包,显示网络封包的详细信息.使用wireshark的人必须了解网络协议,否则就看不懂wireshark了. 为了安全 ...
- java中绘图-----那个鼠标等的监听我还是不太会,,好苦恼啊。不知道这些监听事件是怎么区分的
总结::监听到底该怎么用 事件的区分是靠判断还是 package com.a.b; //我想实现,当我点击一个按钮时,这个frame里可以画出实心的矩形 import java.awt.Color; ...