Sponsored Content
Top Forums Programming How to compile openGL code which is in C++ in ubuntu Post 302356457 by nsmrmd on Friday 25th of September 2009 03:28:53 PM
Old 09-25-2009
The above code looks like a MFC which is for Windows.
This will not work under Ubuntu. Try to implement the same using windowing API's like FLTK or even a simple glut will work.
 

10 More Discussions You Might Find Interesting

1. HP-UX

Unable to compile ANSI compatible code on HP-UX

Hi!!, my HP-UX - 10.2 compiler doesnt appear to support ANSI style of coding. On compiling my C code, it flags error messages like error 1705: Function prototypes are an ANSI Feature Is it a generic problem with the HP compiler or do I need to use some special switches on the command... (9 Replies)
Discussion started by: jyotipg
9 Replies

2. Filesystems, Disks and Memory

Compile a code for running on boot

How can I compile a code that can be runned on boot:?? (2 Replies)
Discussion started by: d4n1l0d
2 Replies

3. UNIX and Linux Applications

How to compile from source code?

Hi all, I downloaded the source code for a pkg. But i dont know how to build from it? I have no prior experience in building from source,so could you pls help me? I tried ./configure(after entering into the dir containing the src codes) but it generated some errors!!!!! Some files... (1 Reply)
Discussion started by: wrapster
1 Replies

4. Solaris

Error when compile source code

Hello,I'm trying to compile source code for Nmap. My $PATH /usr/sbin:/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/local/bin:/usr/css/bin I type ./configure and all goes great.When I type ./make or ./make it says make not found.Why?I need a correct path for make?Thanks in advance. (2 Replies)
Discussion started by: bgf0
2 Replies

5. Ubuntu

i am new to opengl , how to work opengl in ubuntu

Hi, i am new to opengl, how to work openGL in ubuntu ,, i am not getting which packages as to be install and how to install those packages. and how to work with small programs.. Please guide me ,,, it will appriceated ... (7 Replies)
Discussion started by: Ravikishore
7 Replies

6. Programming

How to rotate text in 3D using openGL code

Hi, I want to know how to write text in window and that is to be rotated in 3D using openGL in C language... any answer will have value .... (0 Replies)
Discussion started by: Ravikishore
0 Replies

7. UNIX for Dummies Questions & Answers

Compile & Run Java Code

The java program is a part of speech tagger -> The Stanford NLP (Natural Language Processing) Group The goal is to use this script as part of a webpage to tag parts of speech based on a user-inputted string. I have no idea what to do with the files - I'm a complete *nix noob. I tried running... (4 Replies)
Discussion started by: tguillea
4 Replies

8. Programming

Compile and debug Vim source code

Hi, I want to debug Vim source code with GDB but I can't get it. It seems to run without debugger. Here is my try. I have supressed output of most commands. Tell me if you need them. $ uname -mor 2.6.37-ARCH i686 GNU/Linux $ mkdir ~/birei && cd ~/birei $ wget... (2 Replies)
Discussion started by: birei
2 Replies

9. Programming

C++ for dummies: how to compile a code.

Hi. I wrote a small programm which shows me display's refresh rate #include "stdafx.h" #include "windows.h" #include "iostream" using namespace std; int _tmain(int cout) { HDC hDCScreen = GetDC(NULL); int RefreshFrequency = GetDeviceCaps(hDCScreen, VREFRESH); ReleaseDC(NULL, hDCScreen);... (1 Reply)
Discussion started by: urello
1 Replies

10. Ubuntu

Compile smbfs module in kernel version 3.10 running Ubuntu 12.04 LTS

Is there any way to compile smbfs module in kernel 3.10 running Ubuntu 12.04 LTS. I did a 'make menuconfig' and it shows cifs. I found out online that smbfs is deprecated and replaced by cifs. I have an old system with kernel version 2.4 which only has smbfs (no cifs). Is it possible to compile... (1 Reply)
Discussion started by: Monil
1 Replies
glut(3GLUT)							       GLUT							       glut(3GLUT)

NAME
glut - an introduction to the OpenGL Utility Toolkit SYNOPSIS
#include <GLUT/glut.h> #include <GL/glut.h> DESCRIPTION
The OpenGL Utility Toolkit (GLUT) is a programming interface with ANSI C and FORTRAN bindings for writing window system independent OpenGL programs. The toolkit supports the following functionality: Multiple windows for OpenGL rendering. Callback driven event processing. Sophisticated input devices. An ``idle'' routine and timers. A simple, cascading pop-up menu facility. Utility routines to generate various solid and wire frame objects. Support for bitmap and stroke fonts. Miscellaneous window management functions, including managing overlays. An ANSI C implementation of GLUT for the X Window System has been implemented by the author. Windows NT and OS/2 versions of GLUT are also available. BACKGROUND
One of the major accomplishments in the specification of OpenGL was the isolation of window system dependencies from OpenGL's rendering model. The result is that OpenGL is window system independent. Window system operations such as the creation of a rendering window and the handling of window system events are left to the native window system to define. Necessary interactions between OpenGL and the window system such as creating and binding an OpenGL context to a window are described separately from the OpenGL specification in a window system dependent specification. For example, the GLX specification describes the standard by which OpenGL interacts with the X Window System. The predecessor to OpenGL is IRIS GL. Unlike OpenGL, IRIS GL does specify how rendering windows are created and manipulated. IRIS GL's win- dowing interface is reasonably popular largely because it is simple to use. IRIS GL programmers can worry about graphics programming with- out needing to be an expert in programming the native window system. Experience also demonstrated that IRIS GL's windowing interface was high-level enough that it could be retargeted to different window systems. Silicon Graphics migrated from NeWS to the X Window System without any major changes to IRIS GL's basic windowing interface. Removing window system operations from OpenGL is a sound decision because it allows the OpenGL graphics system to be retargeted to various systems including powerful but expensive graphics workstations as well as mass-production graphics systems like video games, set-top boxes for interactive television, and PCs. Unfortunately, the lack of a window system interface for OpenGL is a gap in OpenGL's utility. Learning native window system APIs such as the X Window System's Xlib or Motif can be daunting. Even those familiar with native window system APIs need to understand the interface that binds OpenGL to the native window system. And when an OpenGL program is written using the native window system interface, despite the portability of the program's OpenGL rendering code, the program itself will be window system dependent. Testing and documenting OpenGL's functionality lead to the development of the tk and aux toolkits. The aux toolkit is used in the examples found in the OpenGL Programming Guide. Unfortunately, aux has numerous limitations and its utility is largely limited to toy programs. The tk library has more functionality than aux but was developed in an ad hoc fashion and still lacks much important functionality that IRIS GL programmers expect, like pop-up menus and overlays. GLUT is designed to fill the need for a window system independent programming interface for OpenGL programs. The interface is designed to be simple yet still meet the needs of useful OpenGL programs. Features from the IRIS GL, aux, and tk interfaces are included to make it easy for programmers used to these interfaces to develop programs for GLUT. PHILOSPHY
GLUT simplifies the implementation of programs using OpenGL rendering. The GLUT application programming interface (API) requires very few routines to display a graphics scene rendered using OpenGL. The GLUT API (like the OpenGL API) is stateful. Most initial GLUT state is defined and the initial state is reasonable for simple programs. The GLUT routines also take relatively few parameters. No pointers are returned. The only pointers passed into GLUT are pointers to charac- ter strings (all strings passed to GLUT are copied, not referenced) and opaque font handles. The GLUT API is (as much as reasonable) window system independent. For this reason, GLUT does not return any native window system handles, pointers, or other data structures. More subtle window system dependencies such as reliance on window system dependent fonts are avoided by GLUT; instead, GLUT supplies its own (limited) set of fonts. For programming ease, GLUT provides a simple menu sub-API. While the menuing support is designed to be implemented as pop-up menus, GLUT gives window system leeway to support the menu functionality in another manner (pull-down menus for example). Two of the most important pieces of GLUT state are the current window and current menu. Most window and menu routines affect the current window or menu respectively. Most callbacks implicitly set the current window and menu to the appropriate window or menu responsible for the callback. GLUT is designed so that a program with only a single window and/or menu will not need to keep track of any window or menu identifiers. This greatly simplifies very simple GLUT programs. GLUT is designed for simple to moderately complex programs focused on OpenGL rendering. GLUT implements its own event loop. For this rea- son, mixing GLUT with other APIs that demand their own event handling structure may be difficult. The advantage of a builtin event dispatch loop is simplicity. GLUT contains routines for rendering fonts and geometric objects, however GLUT makes no claims on the OpenGL display list name space. For this reason, none of the GLUT rendering routines use OpenGL display lists. It is up to the GLUT programmer to compile the output from GLUT rendering routines into display lists if this is desired. GLUT routines are logically organized into several sub-APIs according to their functionality. The sub-APIs are: Initialization. Command line processing, window system initialization, and initial window creation state are controlled by these routines. Beginning Event Processing. This routine enters GLUT's event processing loop. This routine never returns, and it continuously calls GLUT callbacks as necessary. Window Management. These routines create and control windows. Overlay Management. These routines establish and manage overlays for windows. Menu Management. These routines create and control pop-up menus. Callback Registration. These routines register callbacks to be called by the GLUT event processing loop. Color Index Colormap Management. These routines allow the manipulation of color index colormaps for windows. State Retrieval. These routines allows programs to retrieve state from GLUT. Font Rendering. These routines allow rendering of stroke and bitmap fonts. Geometric Shape Rendering. These routines allow the rendering of 3D geometric objects including spheres, cones, icosahedrons, and teapots. CONVENTIONS
GLUT window and screen coordinates are expressed in pixels. The upper left hand corner of the screen or a window is (0,0). X coordinates increase in a rightward direction; Y coordinates increase in a downward direction. Note: This is inconsistent with OpenGL's coordinate scheme that generally considers the lower left hand coordinate of a window to be at (0,0) but is consistent with most popular window sys- tems. Integer identifiers in GLUT begin with one, not zero. So window identifiers, menu identifiers, and menu item indexes are based from one, not zero. In GLUT's ANSI C binding, for most routines, basic types (int, char*) are used as parameters. In routines where the parameters are directly passed to OpenGL routines, OpenGL types (GLfloat) are used. The header files for GLUT should be included in GLUT programs with the following include directive: #include <GL/glut.h> Because a very large window system software vendor (who will remain nameless) has an apparent inability to appreciate that OpenGL's API is independent of their window system API, portable ANSI C GLUT programs should not directly include <GL/gl.h> or <GL/glu.h>. Instead, ANSI C GLUT programs should rely on <GL/glut.h> to include the necessary OpenGL and GLU related header files. The ANSI C GLUT library archive is typically named libglut.a on Unix systems. GLUT programs need to link with the system's OpenGL and GLUT libraries (and any libraries these libraries potentially depend on). A set of window system dependent libraries may also be necessary for linking GLUT programs. For example, programs using the X11 GLUT implementation typically need to link with Xlib, the X extension library, possibly the X Input extension library, the X miscellaneous utilities library, and the math library. An example X11/Unix compile line would look like: cc -o foo foo.c -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm SEE ALSO
glutAddMenuEntry, glutAddSubMenu, glutAttachMenu, glutBitmapCharacter, glutBitmapWidth, glutButtonBoxFunc, glutChangeToMenuEntry, glutChangeToSubMenu, glutCopyColormap, glutCreateMenu, glutCreateSubWindow, glutCreateWindow, glutDestroyMenu, glutDestroyWindow, glutDe- viceGet, glutDialsFunc, glutDisplayFunc, glutEntryFunc, glutEstablishOverlay, glutExtensionSupported, glutFullScreen, glutGet, glutGet- Color, glutGetModifiers, glutIdleFunc, glutInit, glutInitDisplayMode, glutInitWindowPosition, glutKeyboardFunc, glutLayerGet, glutMainLoop, glutMenuStatusFunc, glutMotionFunc, glutMouseFunc, glutOverlayDisplayFunc, glutPopWindow, glutPositionWindow, glutPostOverlayRedisplay, glutPostRedisplay, glutRemoveMenuItem, glutRemoveOverlay, glutReshapeFunc, glutReshapeWindow, glutSetColor, glutSetCursor, glutSetMenu, glutSetWindow, glutSetWindowTitle, glutShowOverlay, glutShowWindow, glutSolidCone, glutSolidCube, glutSolidDodecahedron, glutSolidIcosahe- dron, glutSolidOctahedron, glutSolidSphere, glutSolidTeapot, glutSolidTetrahedron, glutSolidTorus, glutSpaceballButtonFunc, glutSpaceball- MotionFunc, glutSpaceballRotateFunc, glutSpecialFunc, glutStrokeCharacter, glutStrokeWidth, glutSwapBuffers, glutTabletButtonFunc, glut- TabletMotionFunc, glutTimerFunc, glutUseLayer, glutVisibilityFunc, REFERENCES
Mark Kilgard, Programming OpenGL for the X Window System, Addison-Wesley, ISBN 0-201-48359-9, 1996. Mark Kilgard, The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3 (the official GLUT specification). WEB REFERENCES
Main GLUT page http://www.opengl.org/resources/libraries/glut/ GLUT Frequently Asked Question list http://www.opengl.org/resources/libraries/glut/faq/ The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3 http://www.opengl.org/documentation/specs/glut/spec3/spec3.html http://www.opengl.org/documentation/specs/glut/glut-3.spec.ps.gz http://www.opengl.org/documentation/specs/glut/glut-3.spec.pdf AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glut(3GLUT)

Featured Tech Videos

All times are GMT -4. The time now is 12:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy