i build the new version of FreeGLUT 2.6 today
but only for VisualStudio as static *.lib and *.DLL
here for MinGW freeglut V 2.4
read:
using-glut-with-mingwDownload:
freeglut-2.4.0-1.mp.zipJoshy
edit:i compiled the V 2.6 for MinGW too (what is the problem?)
Download: v2.6 static for MinGW or FreeBASIC
freeglut_static.zipcopy the the 3 *.h files in your mingw/include/GL folder
and the freeglut_static.a file in your mingw/lib folder
in C/C++ projects include the main header
#include <GL/freeglut.h>
and add freeglut_static lib to your linker settings
By the way if you use static and dynamic libs together with FreeBASIC you can't use the same *.bi file
in case of a dynamic dll the names must be STDCALL "glutInit@8" and you must link "freeglut"
in case of a static lib the names must be CDECL "_glutInit" and you must link "freeglut_static"
this is why i use #define FGS() and FGF() in freeglut.bi
if i will use the *.dll version i need only
#libpath "lib" ' lib is optional i don't put my lib files in the freebasic lib folder
#include "inc/freeglut.bi" ' inc is optional i don't put my include files in the freebasic folder
in the cas of the static lib i need
#define FREGLUT_STATIC
#libpath "lib" ' lib is optional i don't put my lib files in the freebasic lib folder
#include "inc/freeglut.bi" ' inc is optional i don't put my include files in the freebasic folder
here are my "freeglut.bi" file
in the case of FREEGLUT_STATIC i use EXTERN "C" and END EXTERN
[pre#ifndef __freeglut_bi__
#define __freeglut_bi__
/'
* freeglut.bi
*
* The GLUT-compatible part of the freeglut library include file
*
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
* Creation date: Thu Dec 2 1999
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'/
'
#ifdef __FB_DOS__
# error "target must be Win32 or Linux!"
#endif
'
#ifdef __FB_WIN32__
# include once "windows.bi"
#endif
'
#include once "GL/glu.bi"
'
#libpath "lib"
#ifdef FREEGLUT_STATIC
# inclib "freeglut_static"
#else
# inclib "freeglut"
#endif
'
#define FREEGLUT 1
#define GLUT_API_VERSION 4
#define FREEGLUT_VERSION_2_0 1
#define GLUT_XLIB_IMPLEMENTATION 13
'
#define GLUT_SINGLE 0
#define GLUT_RGB 0
#define GLUT_RGBA 0
#define GLUT_INDEX 1
'
#define GLUT_DOUBLE 2
#define GLUT_ACCUM 4
#define GLUT_ALPHA 8
#define GLUT_DEPTH 16
#define GLUT_STENCIL 32
#define GLUT_MULTISAMPLE 128
#define GLUT_STEREO 256
#define GLUT_LUMINANCE 512
'
#define GLUT_LEFT_BUTTON 0
#define GLUT_MIDDLE_BUTTON 1
#define GLUT_RIGHT_BUTTON 2
#define GLUT_WHEEL_UP 3
#define GLUT_WHEEL_DOWN 4
#define GLUT_XBUTTON1 5
#define GLUT_XBUTTON2 6
'
#define GLUT_DOWN 0
#define GLUT_UP 1
'
#define GLUT_KEY_F1 1
#define GLUT_KEY_F2 2
#define GLUT_KEY_F3 3
#define GLUT_KEY_F4 4
#define GLUT_KEY_F5 5
#define GLUT_KEY_F6 6
#define GLUT_KEY_F7 7
#define GLUT_KEY_F8 8
#define GLUT_KEY_F9 9
#define GLUT_KEY_F10 10
#define GLUT_KEY_F11 11
#define GLUT_KEY_F12 12
#define GLUT_KEY_LEFT 100
#define GLUT_KEY_UP 101
#define GLUT_KEY_RIGHT 102
#define GLUT_KEY_DOWN 103
#define GLUT_KEY_PAGE_UP 104
#define GLUT_KEY_PAGE_DOWN 105
#define GLUT_KEY_HOME 106
#define GLUT_KEY_END 107
#define GLUT_KEY_INSERT 108
'
#define GLUT_LEFT 0
#define GLUT_ENTERED 1
'
#define GLUT_MENU_NOT_IN_USE 0
#define GLUT_MENU_IN_USE 1
'
#define GLUT_HIDDEN 0
#define GLUT_NOT_VISIBLE 0
#define GLUT_VISIBLE 1
'
#define GLUT_FULLY_RETAINED 1
#define GLUT_PARTIALLY_RETAINED 2
#define GLUT_FULLY_COVERED 3
'
#define GLUT_RED 0
#define GLUT_GREEN 1
#define GLUT_BLUE 2
'
#define GLUT_WINDOW_X 100
#define GLUT_WINDOW_Y 101
#define GLUT_WINDOW_WIDTH 102
#define GLUT_WINDOW_HEIGHT 103
#define GLUT_WINDOW_BUFFER_SIZE 104
#define GLUT_WINDOW_STENCIL_SIZE 105
#define GLUT_WINDOW_DEPTH_SIZE 106
#define GLUT_WINDOW_RED_SIZE 107
#define GLUT_WINDOW_GREEN_SIZE 108
#define GLUT_WINDOW_BLUE_SIZE 109
#define GLUT_WINDOW_ALPHA_SIZE 110
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
#define GLUT_WINDOW_DOUBLEBUFFER 115
#define GLUT_WINDOW_RGBA 116
#define GLUT_WINDOW_PARENT 117
#define GLUT_WINDOW_NUM_CHILDREN 118
#define GLUT_WINDOW_COLORMAP_SIZE 119
#define GLUT_WINDOW_NUM_SAMPLES 120
#define GLUT_WINDOW_STEREO 121
#define GLUT_WINDOW_CURSOR 122
#define GLUT_WINDOW_FORMAT_ID 123
'
#define GLUT_SCREEN_WIDTH 200
#define GLUT_SCREEN_HEIGHT 201
#define GLUT_SCREEN_WIDTH_MM 202
#define GLUT_SCREEN_HEIGHT_MM 203
'
#define GLUT_MENU_NUM_ITEMS 300
'
#define GLUT_DISPLAY_MODE_POSSIBLE 400
'
#define GLUT_INIT_WINDOW_X 500
#define GLUT_INIT_WINDOW_Y 501
#define GLUT_INIT_WINDOW_WIDTH 502
#define GLUT_INIT_WINDOW_HEIGHT 503
#define GLUT_INIT_DISPLAY_MODE 504
'
#define GLUT_HAS_KEYBOARD 600
#define GLUT_HAS_MOUSE 601
#define GLUT_HAS_SPACEBALL 602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
#define GLUT_HAS_TABLET 604
#define GLUT_NUM_MOUSE_BUTTONS 605
#define GLUT_NUM_SPACEBALL_BUTTONS 606
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
#define GLUT_NUM_DIALS 608
#define GLUT_NUM_TABLET_BUTTONS 609
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
#define GLUT_DEVICE_KEY_REPEAT 611
#define GLUT_HAS_JOYSTICK 612
#define GLUT_OWNS_JOYSTICK 613
#define GLUT_JOYSTICK_BUTTONS 614
#define GLUT_JOYSTICK_AXES 615
#define GLUT_JOYSTICK_POLL_RATE 616
'
#define GLUT_ELAPSED_TIME 700
'
#define GLUT_OVERLAY_POSSIBLE 800
#define GLUT_LAYER_IN_USE 801
#define GLUT_HAS_OVERLAY 802
#define GLUT_TRANSPARENT_INDEX 803
#define GLUT_NORMAL_DAMAGED 804
#define GLUT_OVERLAY_DAMAGED 805
'
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
#define GLUT_VIDEO_RESIZE_IN_USE 901
#define GLUT_VIDEO_RESIZE_X_DELTA 902
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
#define GLUT_VIDEO_RESIZE_X 906
#define GLUT_VIDEO_RESIZE_Y 907
#define GLUT_VIDEO_RESIZE_WIDTH 908
#define GLUT_VIDEO_RESIZE_HEIGHT 909
'
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
'
#define GLUT_ACTIVE_SHIFT 1
#define GLUT_ACTIVE_CTRL 2
#define GLUT_ACTIVE_ALT 4
'
#define GLUT_CURSOR_RIGHT_ARROW 0
#define GLUT_CURSOR_LEFT_ARROW 1
#define GLUT_CURSOR_INFO 2
#define GLUT_CURSOR_DESTROY 3
#define GLUT_CURSOR_HELP 4
#define GLUT_CURSOR_CYCLE 5
#define GLUT_CURSOR_SPRAY 6
#define GLUT_CURSOR_WAIT 7
#define GLUT_CURSOR_TEXT 8
#define GLUT_CURSOR_CROSSHAIR 9
#define GLUT_CURSOR_UP_DOWN 10
#define GLUT_CURSOR_LEFT_RIGHT 11
#define GLUT_CURSOR_TOP_SIDE 12
#define GLUT_CURSOR_BOTTOM_SIDE 13
#define GLUT_CURSOR_LEFT_SIDE 14
#define GLUT_CURSOR_RIGHT_SIDE 15
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
'
#define GLUT_CURSOR_INHERIT 100
#define GLUT_CURSOR_NONE 101
#define GLUT_CURSOR_FULL_CROSSHAIR 102
'
#define GLUT_KEY_REPEAT_OFF 0
#define GLUT_KEY_REPEAT_ON 1
#define GLUT_KEY_REPEAT_DEFAULT 2
'
#define GLUT_JOYSTICK_BUTTON_A 1
#define GLUT_JOYSTICK_BUTTON_B 2
#define GLUT_JOYSTICK_BUTTON_C 4
#define GLUT_JOYSTICK_BUTTON_D 8
'
#define GLUT_GAME_MODE_ACTIVE 0
#define GLUT_GAME_MODE_POSSIBLE 1
#define GLUT_GAME_MODE_WIDTH 2
#define GLUT_GAME_MODE_HEIGHT 3
#define GLUT_GAME_MODE_PIXEL_DEPTH 4
#define GLUT_GAME_MODE_REFRESH_RATE 5
#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
'
#ifdef FREEGLUT_STATIC
extern "C"
#endif
'
#define FGS(n) declare sub n
#define FGF(n) declare function n
'
FGS(glutInit) (byref argcp as integer, byref argv as byte ptr)
FGS(glutInitDisplayMode) (byval mode as uinteger)
FGS(glutInitDisplayString) (byval string as zstring ptr)
FGS(glutInitWindowPosition) (byval x as integer, byval y as integer)
FGS(glutInitWindowSize) (byval width as integer, byval height as integer)
FGS(glutMainLoop) ()
FGF(glutCreateWindow) (byval title as zstring ptr) as integer
FGF(glutCreateSubWindow) (byval win as integer, byval x as integer, byval y as integer, byval width as integer, byval height as integer) as integer
FGS(glutDestroyWindow) (byval win as integer)
FGS(glutPostRedisplay) ()
FGS(glutPostWindowRedisplay) (byval win as integer)
FGS(glutSwapBuffers) ()
FGF(glutGetWindow) () as integer
FGS(glutSetWindow) (byval win as integer)
FGS(glutSetWindowTitle) (byval title as zstring ptr)
FGS(glutSetIconTitle) (byval title as zstring ptr)
FGS(glutPositionWindow) (byval x as integer, byval y as integer)
FGS(glutReshapeWindow) (byval width as integer, byval height as integer)
FGS(glutPopWindow) ()
FGS(glutPushWindow) ()
FGS(glutIconifyWindow) ()
FGS(glutShowWindow) ()
FGS(glutHideWindow) ()
FGS(glutFullScreen) ()
FGS(glutSetCursor) (byval cursor as integer)
FGS(glutWarpPointer) (byval x as integer, byval y as integer)
FGS(glutEstablishOverlay) ()
FGS(glutRemoveOverlay) ()
FGS(glutUseLayer) (byval layer as GLenum)
FGS(glutPostOverlayRedisplay) ()
FGS(glutPostWindowOverlayRedisplay) (byval win as integer)
FGS(glutShowOverlay) ()
FGS(glutHideOverlay) ()
FGF(glutEnterGameMode) () as integer
FGS(glutLeaveGameMode) ()
FGF(glutGameModeGet) (byval mode as GLenum) as integer
FGS(glutGameModeString) (byval string as zstring ptr)
FGF(glutCreateMenu) (byval func as sub cdecl(byval as integer)) as integer
FGS(glutDestroyMenu) (byval menu as integer)
FGF(glutGetMenu) () as integer
FGS(glutSetMenu) (byval menu as integer)
FGS(glutAddMenuEntry) (byval label as zstring ptr, byval value as integer)
FGS(glutAddSubMenu) (byval label as zstring ptr, byval submenu as integer)
FGS(glutChangeToMenuEntry) (byval item as integer, byval label as zstring ptr, byval value as integer)
FGS(glutChangeToSubMenu) (byval item as integer, byval label as zstring ptr, byval submenu as integer)
FGS(glutRemoveMenuItem) (byval item as integer)
FGS(glutAttachMenu) (byval button as integer)
FGS(glutDetachMenu) (byval button as integer)
'
FGS(glutDisplayFunc ) (byval func as sub cdecl())
FGS(glutReshapeFunc ) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutKeyboardFunc ) (byval func as sub cdecl(byval as ubyte , byval as integer, byval as integer))
FGS(glutMouseFunc ) (byval func as sub cdecl(byval as integer, byval as integer, byval as integer, byval as integer))
FGS(glutMotionFunc ) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutPassiveMotionFunc ) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutEntryFunc ) (byval func as sub cdecl(byval as integer))
FGS(glutVisibilityFunc ) (byval func as sub cdecl(byval as integer))
FGS(glutIdleFunc ) (byval func as sub cdecl())
FGS(glutTimerFunc ) (byval millis as uinteger, byval func as sub cdecl(byval as integer), byval value as integer)
FGS(glutMenuStateFunc ) (byval func as sub cdecl(byval as integer))
FGS(glutSpecialFunc ) (byval func as sub cdecl(byval as integer, byval as integer, byval as integer))
FGS(glutSpaceballMotionFunc) (byval func as sub cdecl(byval as integer, byval as integer, byval as integer))
FGS(glutSpaceballRotateFunc) (byval func as sub cdecl(byval as integer, byval as integer, byval as integer))
FGS(glutSpaceballButtonFunc) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutButtonBoxFunc ) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutDialsFunc ) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutTabletMotionFunc ) (byval func as sub cdecl(byval as integer, byval as integer))
FGS(glutTabletButtonFunc ) (byval func as sub cdecl(byval as integer, byval as integer, byval as integer, byval as integer))
FGS(glutMenuStatusFunc ) (byval func as sub cdecl(byval as integer, byval as integer, byval as integer))
FGS(glutOverlayDisplayFunc ) (byval func as sub cdecl())
FGS(glutWindowStatusFunc ) (byval func as sub cdecl(byval as integer))
FGS(glutKeyboardUpFunc ) (byval func as sub cdecl(byval as ubyte , byval as integer, byval as integer))
FGS(glutSpecialUpFunc ) (byval func as sub cdecl(byval as integer , byval as integer, byval as integer))
FGS(glutJoystickFunc ) (byval func as sub cdecl(byval as uinteger, byval as integer, byval as integer, byval as integer), byval pollInterval as integer)
'
FGF(glutVideoResizeGet) (byval param as GLenum) as integer
FGS(glutSetupVideoResizing) ()
FGS(glutStopVideoResizing) ()
FGS(glutVideoResize) (byval x as integer, byval y as integer, byval width as integer, byval height as integer)
FGS(glutVideoPan) (byval x as integer, byval y as integer, byval width as integer, byval height as integer)
FGS(glutReportErrors) ()
FGS(glutSetColor) (byval as integer, byval red as GLfloat, byval green as GLfloat, byval blue as GLfloat)
FGF(glutGetColor) (byval ndx as integer, byval component as integer) as GLfloat
FGS(glutCopyColormap) (byval win as integer)
FGF(glutGet) (byval type as GLenum) as integer
FGF(glutDeviceGet) (byval type as GLenum) as integer
FGF(glutExtensionSupported) (byval name as zstring ptr) as integer
FGF(glutGetModifiers) as integer
'
'FGS(glutIgnoreKeyRepeat) (byval ignore as integer)
'
FGS(glutSetKeyRepeat) (byval repeatMode as integer)
FGS(glutForceJoystickFunc) ()
FGF(glutLayerGet) (byval type as GLenum) as integer
FGS(glutBitmapCharacter) (byval font as any ptr, byval character as integer)
FGF(glutBitmapWidth) (byval font as any ptr, byval character as integer) as integer
FGS(glutStrokeCharacter) (byval font as any ptr, byval character as integer)
FGF(glutStrokeWidth) (byval font as any ptr, byval character as integer) as integer
FGF(glutBitmapLength) (byval font as any ptr, byval string as ubyte ptr) as integer
FGF(glutStrokeLength) (byval font as any ptr, byval string as ubyte ptr) as integer
'
FGS(glutWireSphere) (byval radius as GLdouble, byval slices as GLint, byval stacks as GLint)
FGS(glutWireCone) (byval base as GLdouble, byval height as GLdouble, byval slices as GLint, byval stacks as GLint)
FGS(glutWireCube) (byval size as GLdouble)
FGS(glutWireTorus) (byval innerRadius as GLdouble, byval outerRadius as GLdouble, byval sides as GLint, byval rings as GLint)
FGS(glutWireDodecahedron) ()
FGS(glutWireTeapot) (byval size as GLdouble)
FGS(glutWireOctahedron) ()
FGS(glutWireTetrahedron) ()
FGS(glutWireIcosahedron) ()
'
FGS(glutSolidSphere) (byval radius as GLdouble, byval slices as GLint, byval stacks as GLint)
FGS(glutSolidCone) (byval base as GLdouble, byval height as GLdouble, byval slices as GLint, byval stacks as GLint)
FGS(glutSolidCube) (byval size as GLdouble)
FGS(glutSolidTorus) (byval innerRadius as GLdouble, byval outerRadius as GLdouble, byval sides as GLint, byval rings as GLint)
FGS(glutSolidDodecahedron) ()
FGS(glutSolidTeapot) (byval size as GLdouble)
FGS(glutSolidOctahedron) ()
FGS(glutSolidTetrahedron) ()
FGS(glutSolidIcosahedron) ()
'
' GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
#define GLUT_ACTION_EXIT 0
#define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1
#define GLUT_ACTION_CONTINUE_EXECUTION 2
'
' Create a new rendering context when the user opens a new window?
#define GLUT_CREATE_NEW_CONTEXT 0
#define GLUT_USE_CURRENT_CONTEXT 1
'
' Direct/Indirect rendering context options (has meaning only in Unix/X11)
#define GLUT_FORCE_INDIRECT_CONTEXT 0
#define GLUT_ALLOW_DIRECT_CONTEXT 1
#define GLUT_TRY_DIRECT_CONTEXT 2
#define GLUT_FORCE_DIRECT_CONTEXT 3
'
' GLUT API Extension macro definitions -- the glutGet parameters
#define GLUT_ACTION_ON_WINDOW_CLOSE &H01F9
'
#define GLUT_WINDOW_BORDER_WIDTH &H01FA
#define GLUT_WINDOW_HEADER_HEIGHT &H01FB
'
#define GLUT_VERSION &H01FC
'
#define GLUT_RENDERING_CONTEXT &H01FD
#define GLUT_DIRECT_RENDERING &H01FE
'
/'
New tokens for glutInitDisplayMode.
Only one GLUT_AUXn bit may be used at a time.
Value &H0400 is defined in OpenGLUT.
'/
#define GLUT_AUX1 &H1000
#define GLUT_AUX2 &H2000
#define GLUT_AUX3 &H4000
#define GLUT_AUX4 &H8000
'
'
' Process loop function, see freeglut_main.c
FGS(glutMainLoopEvent) ()
FGS(glutLeaveMainLoop) ()
'
' Window-specific callback functions, see freeglut_callbacks.c
FGS(glutMouseWheelFunc) (byval func as sub cdecl(as integer,as integer,as integer,as integer) )
FGS(glutCloseFunc) (byval func as sub cdecl() )
FGS(glutWMCloseFunc) (byval func as sub cdecl() )
' A. Donev: Also a destruction callback for menus
FGS(glutMenuDestroyFunc) (byval func as sub cdecl())
'
' State setting and retrieval functions, see freeglut_state.c
FGS(glutSetOption) (option_flag as integer,value as integer)
' A.Donev: User-data manipulation
FGF(glutGetWindowData) () as any ptr
FGS(glutSetWindowData) (lpData as any ptr)
FGF(glutGetMenuData) () as any ptr
FGS(gglutSetMenuData) (lpData as any ptr)
'
' Font stuff, see freeglut_font.c
FGF(glutBitmapHeight) (font as any ptr) as integer
FGF(glutStrokeHeight) (font as any ptr) as GLFLOAT
FGS(glutBitmapString) (font as any ptr,s as zstring ptr)
FGS(glutStrokeString) (font as any ptr,s as zstring ptr)
'
' Geometry functions, see freeglut_geometry.c
FGS(glutWireRhombicDodecahedron) ()
FGS(glutSolidRhombicDodecahedron) ()
FGS(glutWireSierpinskiSponge) (num_levels as integer,offset() as double,scale as double)
FGS(glutSolidSierpinskiSponge) (num_levels as integer,offset() as double,scale as double)
FGS(glutWireCylinder) (radius as double,height as double,slices as integer, stacks as integer)
FGS(glutSolidCylinder) (GLdouble as double,height as double,slices as integer,stacks as integer)
'
' Extension functions, see freeglut_ext.c
type GLUTproc as sub cdecl ()
FGF(glutGetProcAddress) (procName as zstring ptr) as GLUTproc
'
#ifdef FREEGLUT_STATIC
end extern
#endif
'
#endif[/pre]