WinBasicGL
Created by Remo Riglioni (c) 2007

How To Write C DLLs and Call them from WinBasicGLDownload(Obj3D.zip)



You can use DLLs to add new commands to your WinBasiGL development environment, in this tutorial we will show how to write a DLL for WinBasicGL using the "C language". To do this, first of all, we are need of a C compiler to compile the final DLL. There is a large number of C compiler, here we will use "Pelles C", a free compiler that you can get at www.smorgasbordet.com. Now we write a DLL with the purpose to create and manipulate simple 3D objects. Start the DLL project : Create a new project DLL
Select the option "create module definition file for the linker"
The wizard will create 3 files ("dllmain.c","Obj3D.def","Obj3D.h")
Insert into "dllmain.c" the function to use as command, for example, we could make a function "wbGLdrawCube" to draw a textured cube, remember to include the opengl header files.
Declare the funcion into export section of definition module (Obj3D.def) Remember to include opengl32.lib and glu32.lib into linker options.
Now you can build your DLL.
Next step is import into WinBasicGL the new commands...ImportDll
Home