Installing openGL in Netbeans 7.2

  • From: "lopatnov" < >
  • To:
  • Subject: Installing openGL in Netbeans 7.2
  • Date: Sat, 15 Sep 2012 07:54:59 -0400

1. Install MinGW with msys http://sourceforge.net/projects/mingw/files/. ;
2. Set the options for Netbeans compilers Service->Params (see 
http://stackoverflow.com/questions/1184599/how-to-correctly-configure-netbeans-6-7-and-c-on-windows).
 
3. Download glfw http://www.glfw.org/download.html. Unpack include into ;
include of MinGW compiler, lib into lib. 
4. Create the new project with this compiler. 
5. Set the options of your project. Right-click the project node of the 
YourApplication_1 project and choose Properties. You will have this 
http://netbeans.org/images_www/articles/72/cnd/quickstart/project_properties.png
6. Set the linker options (see screenshots), add to project libglfw.a, 
libopengl32.a, libglu32.a. 
7. Some code:

Code:

#include <GL/glfw.h>
#include <stdlib.h>
int main( void )
{
int running = GL_TRUE;
// Initialize GLFW
if( !glfwInit() )
{
exit( EXIT_FAILURE );
}
// Open an OpenGL window
if( !glfwOpenWindow( 300,300, 0,0,0,0,0,0, GLFW_WINDOW ) )
{
glfwTerminate();
exit( EXIT_FAILURE );
}
// Main loop
while( running )
{
// OpenGL rendering goes here...
glClear( GL_COLOR_BUFFER_BIT );
// Swap front and back rendering buffers
glfwSwapBuffers();
// Check if ESC key was pressed or window was closed
running = !glfwGetKey( GLFW_KEY_ESC ) &&
glfwGetWindowParam( GLFW_OPENED );
}
// Close window and terminate GLFW
glfwTerminate();
// Exit program
exit( EXIT_SUCCESS );
}



8. run it




Attachments: 
http://forums.netbeans.org//files/linker_options_178.gif



Installing openGL in Netbeans 7.2

BrookwellB 09/12/2012

<Possible follow-up(s)>

Installing openGL in Netbeans 7.2

BrookwellB 09/12/2012

Installing openGL in Netbeans 7.2

lopatnov 09/15/2012

Project Features

About this Project

CND was started in November 2009, is owned by Leonid Lenyashin, and has 130 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close