Changeset 31
- Timestamp:
- 07/21/04 10:52:09 (4 years ago)
- Files:
-
- trunk/DerelictGL/Makefile (modified) (4 diffs)
- trunk/DerelictGL/README (modified) (4 diffs)
- trunk/DerelictGL/derelict/opengl/gl.d (modified) (1 diff)
- trunk/DerelictGLU/Makefile (modified) (2 diffs)
- trunk/DerelictGLU/README (modified) (2 diffs)
- trunk/DerelictGLU/derelict/glu/glu.d (modified) (1 diff)
- trunk/DerelictSDL/Makefile (modified) (2 diffs)
- trunk/DerelictSDL/README (modified) (2 diffs)
- trunk/DerelictSDL/derelict/sdl/sdl.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/DerelictGL/Makefile
r20 r31 5 5 6 6 DFLAGS = -v 7 LIBFLAGS = -c 7 LIBFLAGS = -c -n 8 8 DINC = -I$(SRC.DIR) 9 9 … … 11 11 OGL.SRC = \ 12 12 $(OGL.SRC.DIR)\gl.d \ 13 $(OGL.SRC.DIR)\gltypes.d \ 13 $(OGL.SRC.DIR)\gltypes.d 14 15 GLEE.SRC.DIR = $(SRC.DIR) 16 GLEE.SRC = \ 14 17 $(SRC.DIR)\glee.d \ 15 18 $(SRC.DIR)\glConstants.d … … 18 21 OGL.OBJ = \ 19 22 $(OGL.OBJ.DIR)\gl.obj \ 20 $(OGL.OBJ.DIR)\gltypes.obj \ 23 $(OGL.OBJ.DIR)\gltypes.obj 24 25 GLEE.OBJ.DIR = $(OBJ.DIR)\glee 26 GLEE.OBJ = \ 21 27 $(OGL.OBJ.DIR)\glee.obj \ 22 28 $(OGL.OBJ.DIR)\glConstants.obj … … 26 32 DEFAULT: lib 27 33 28 clean: 29 del $(OGL.OBJ.DIR)\*.obj 34 clean_globj: 35 @rd /S /Q $(OGL.OBJ.DIR) 36 37 clean_gleeobj: 38 @rd /S /Q $(GLEE.OBJ.DIR) 39 40 clean_lib: 41 @del $(OGL.LIB).lib 30 42 31 cleanall: 32 del $(OGL.OBJ.DIR)\*.obj 33 del $(OGL.LIB).lib 34 del $(OGL.LIB).bak 43 clean: clean_globj clean_gleeobj 35 44 36 lib: 37 dmd $(OGL.SRC) -c $(DFLAGS) $(DINC) -od$(OGL.OBJ.DIR) 45 cleanall: clean clean_lib 46 47 gl: 48 @md $(OGL.OBJ.DIR) 49 dmd $(OGL.SRC) -c $(DFLAGS) $(DINC) -od$(OGL.OBJ.DIR) 50 51 glee: 52 @md $(GLEE.OBJ.DIR) 53 dmd $(GLEE.SRC) -c $(DFLAGS) $(DINC) -od$(OGL.OBJ.DIR) 54 55 lib_gl: 38 56 lib $(LIBFLAGS) $(OGL.LIB).lib $(OGL.OBJ) 57 58 lib_glglee: 59 lib $(LIBFLAGS) $(OGL.LIB).lib $(OGL.OBJ) $(GLEE.OBJ) 60 61 lib: gl glee lib_glglee 39 62 63 lib_noglee: gl lib_gl 64 trunk/DerelictGL/README
r20 r31 29 29 30 30 In your code, you need to import the derelict.opengl.gl module. To make use 31 of extensions, import glee;31 of GLEE extensions, import glee; 32 32 33 33 ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ … … 38 38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 39 39 40 During initialization of your application, you need to make a call to 41 dglLoad.This will load the shared library, platform-specific core gl functions40 Before calling any OpenGL functions, you need to make a call to DerelictGL_Load. 41 This will load the shared library, platform-specific core gl functions 42 42 (such as the wgl* functions on Windows), and all core GL 1.1 functions. If 43 43 you only require OpenGL 1.1, then you are finished initializing DerelictGL and 44 44 can go on about your business. 45 45 46 If you require the functionality of OpenGL 1.2+ or any extensions, then you'll 47 need to make a call to GLeeInit. The catch is that you must first create 48 and activate an OpenGL context (if you aren't sure what I'm talking about, take 49 a gander at the nehe.gamedev.net OpenGL tutorials). OpenGL requires that a GL 50 context be active before querying for extensions. This is why dglLoad only loads 51 the core 1.1 functions. Once your context is activated, calling GLeeInit 52 will load all available core OpenGL 1.5 functions as well as all available 53 extensions. 46 If you wish to use GLee, then you'll need to make a call to GLeeInit. The catch 47 is that you must first create and activate an OpenGL context (if you aren't sure 48 what I'm talking about, take a gander at the nehe.gamedev.net OpenGL tutorials). 49 OpenGL requires that a GL context be active before querying for extensions. This 50 is why DerelictGL_Load only loads the core 1.1 functions. Once your context is 51 activated, calling GLeeInit will load all available core OpenGL 1.5 functions as 52 well as all available extensions. 53 54 Additionally, the use of GLee requires that you link to the C library GLee.lib 55 found in <derelict_dir>\DerelictGL\glee_dist\cbuild. GLee is a static library, 56 and not a DLL. 57 58 If you prefer lionking to DerelictGL without including GLee, you can either include 59 GL.d and GL.obj on your project's build path, or make the DerelictGL library with 60 the command 'make lib_noglee' (see BUILDING below). You will then have to setup 61 and load any extensions manually. 54 62 55 63 ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ 56 64 57 65 // load the shared library and Core 1.1 functions via DerelictGL 58 dglLoad();66 DerelictGL_Load(); 59 67 60 68 // app-specific code to init an OpenGL context goes here … … 103 111 such as the vendor string) you can use glGetString as normal. Note, however, that 104 112 GLee provides some convenience functions which can be used to get standard and 105 platform-specific extension , as well as error, strings:113 platform-specific extensions, as well as error, strings: 106 114 107 115 GLeeGetExtStrGL(); … … 118 126 119 127 1) ensure that both dmd\bin and dm\bin are on your path 120 2) from a command prompt, cd to <derelict_dir>\src\derelict\opengl 121 3) type 'make' or 'make lib' to build derelictGL.lib 128 2) from a command prompt, cd to <derelict_dir>\DerelictGL 129 3) type 'make' or 'make lib' to build derelictGL.lib with GLee 130 optionally type 'make lib_noglee' to build derelictGL.lib without GLee 122 131 4) optionally type 'make clean' to delete all object files OR 123 optionally type 'make cleanall' to delete all object , lib and bakfiles124 5) run go.bat to build the C library glee.lib - this only need be done once but125 is required to make use of GLee.132 optionally type 'make cleanall' to delete all object and lib files 133 5) optionally run <derelict_dir>\DerelictGL\glee_dist\cbuild\go.bat to build the 134 C library GLee.lib - this only need be done once but is required to make use of GLee. 126 135 trunk/DerelictGL/derelict/opengl/gl.d
r20 r31 205 205 * Loads all core GL 1.0 & 1.1 functions 206 206 */ 207 private void loadGL()207 private void DerelictGL_Load() 208 208 { 209 209 // gl 1.0 trunk/DerelictGLU/Makefile
r20 r31 6 6 7 7 DFLAGS = -v 8 LIBFLAGS = -c 8 LIBFLAGS = -c -n 9 9 DINC = -I$(SRC.DIR) -I$(OGL.SRC.DIR) 10 10 … … 21 21 DEFAULT: lib 22 22 23 clean :24 del $(GLU.OBJ.DIR)\*.obj23 clean_obj: 24 @rd /S /Q $(GLU.OBJ.DIR) 25 25 26 cleanall: 27 del $(GLU.OBJ.DIR)\*.obj 28 del $(GLU.LIB).lib 29 del $(GLU.LIB).bak 26 clean_lib: 27 @del $(GLU.LIB).lib 28 29 clean: clean_obj 30 31 cleanall: clean clean_lib 30 32 31 33 lib: 34 @md $(GLU.OBJ.DIR) 32 35 dmd $(GLU.SRC) -c $(DFLAGS) $(DINC) -od$(GLU.OBJ.DIR) 33 36 lib $(LIBFLAGS) $(GLU.LIB).lib $(GLU.OBJ) trunk/DerelictGLU/README
r23 r31 27 27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 28 29 During initialization of your application, you need to make a call to30 dgluLoad. This will load the shared library.29 Before you attemtp to call any GLU functions, you need to make a call to 30 DerelictGLU_Load. This will load the shared library. 31 31 32 32 ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ 33 33 34 // load the shared library 35 dgluLoad(); 34 // load the shared library - the try...catch block is optional of course 35 try 36 { 37 DerelictGLU_Load(); 38 } 39 catch(Exception e) 40 { 41 ... 42 } 36 43 37 44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 47 54 48 55 1) ensure that both dmd\bin and dm\bin are on your path 49 2) from a command prompt, cd to <derelict_dir>\ src\derelict\glu56 2) from a command prompt, cd to <derelict_dir>\DerelictGLU 50 57 3) type 'make' or 'make lib' to build derelictGLU.lib 51 58 4) optionally type 'make clean' to delete all object files OR 52 optionally type 'make cleanall' to delete all object, lib and bakfiles59 optionally type 'make cleanall' to delete all object, and lib files trunk/DerelictGLU/derelict/glu/glu.d
r20 r31 47 47 } 48 48 49 public void dgluLoad()49 public void DerelictGLU_Load() 50 50 { 51 51 if(hglu !== null) trunk/DerelictSDL/Makefile
r20 r31 5 5 6 6 DFLAGS = -v 7 LIBFLAGS = -c 7 LIBFLAGS = -c -n 8 8 DINC = -I$(SRC.DIR) 9 9 … … 62 62 DEFAULT: lib 63 63 64 clean :65 del $(SDL.OBJ.DIR)\*.obj64 clean_obj: 65 @rd /S /Q $(SDL.OBJ.DIR) 66 66 67 cleanall: 68 del $(SDL.OBJ.DIR)\*.obj 69 del $(SDL.LIB).lib 70 del $(SDL.LIB).bak 67 clean_lib: 68 @del $(SDL.LIB).lib 69 70 clean: clean_obj 71 72 cleanall: clean clean_lib 71 73 72 74 lib: 75 @md $(SDL.OBJ.DIR) 73 76 dmd $(SDL.SRC) -c $(DFLAGS) $(DINC) -od$(SDL.OBJ.DIR) 74 77 lib $(LIBFLAGS) $(SDL.LIB).lib $(SDL.OBJ) trunk/DerelictSDL/README
r23 r31 35 35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 36 36 37 During initialization of your application, you need to make a call to 38 DSDL_Load.This will load the shared library.37 Before calling any SDL functions, you need to make a call to DerelictSDL_Load. 38 This will load the shared library. 39 39 40 40 ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ 41 41 42 // load the shared library 43 DSDL_Load(); 42 // load the shared library - the try...catch block is optional of course 43 try 44 { 45 DerelictSDL_Load(); 46 } 47 catch(Exception e) 48 { 49 ... 50 } 44 51 45 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 46 53 47 From that point you can call SDL functions as normal. 54 From that point you can call SDL functions as normal. Don't forget to make sure 55 that SDL.dll is on the path. 48 56 49 57 -------------------------------------------------------------------------------- … … 54 62 55 63 1) ensure that both dmd\bin and dm\bin are on your path 56 2) from a command prompt, cd to <derelict_dir>\ src\derelict\sdl64 2) from a command prompt, cd to <derelict_dir>\DerelictSDL 57 65 3) type 'make' or 'make lib' to build derelictSDL.lib 58 66 4) optionally type 'make clean' to delete all object files OR 59 optionally type 'make cleanall' to delete all object , lib and bakfiles67 optionally type 'make cleanall' to delete all object and lib files trunk/DerelictSDL/derelict/sdl/sdl.d
r20 r31 57 57 } 58 58 59 public void D SDL_Load()59 public void DerelictSDL_Load() 60 60 { 61 61 if(hsdl !== null)
