clanlib-1.0~svn3827/0000755000175000017500000000000011256452620014664 5ustar bdefreesebdefreeseclanlib-1.0~svn3827/INSTALL.win320000644000175000017500000002471111256452575016674 0ustar bdefreesebdefreese$Id: INSTALL.win32,v 1.11 2004/03/28 00:13:14 sphair Exp $ Readme file for ClanLib 1.0.x under Win32 --------------------------------------------------------------------------- This readme will guide you with installing, compiling ClanLib and creating your first ClanLib application. If you have downloaded the binaries, you can skip section 3 and 4. 1. Getting started 2. Preparing installation 3. Configuring ClanLib 4. Compiling ClanLib 5. Testing ClanLib 6. Creating applications with ClanLib 7. Creating a workspace for your application 8. Problems ? 1. Getting started --------------------------------------------------------------------------- Microsoft Developer Studio 7.x or 8.x is the recommended versions to use with ClanLib. Visual Studio Express will also work, but it requires a bit more manual configuration for each ClanLib project. Microsoft Developer Studio 6.0 might also work, but we don't provide precompiled binaries for external libraries for that. Go to http://clanlib.org/download.html and download the precompiled binaries, at least libjpeg and libpng multithreaded libraries. If you need more functionality in ClanLib, you can download those other libraries you need. Install these libraries in a directory - remember which one, because you need to enter that information in the next section. If you are using VC6, You MUST install service pack 5 from http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/ It is also recommended to install latest Microsoft Platform SDK, which will give you a much newer set of include files and libraries, making it possible to use things Microsoft invented since 1998. If you are using VS.Net Express, then you will HAVE to do this. The Microsoft Platform SDK is available at: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ Windows builds of ClanLib use DirectX's DirectInput8 for input, so you'll also need to install a recent version (8+) of the DirectX SDK. DirectX SDK Downloads http://msdn.microsoft.com/directx/sdk/ 2. Preparing installation --------------------------------------------------------------------------- The first step in using ClanLib under Windows is to setup a sane build environment. This involves two things: 1. ClanLib must be able to locate the libraries it uses. 2. ClanLib must know where to install itself. My personal build environment is setup as follows using "c:\My Documents" as base path. (You don't need to follow the same scheme, put your libraries where it fits you). "c:\My Documents\lib" contains all .lib files that didn't come along with msvc++ and that are needed by ClanLib. "c:\My Documents\include" contains all include files needed by the libs. Here is how it looks like after I've installed Zlib: c:\My Documents\lib\zlib.lib c:\My Documents\include\zlib.h c:\My Documents\include\zconf.h You must configure Visual C++ so it knows where to find the include and library files. This is done through the Tools -> Options -> Projects -> VC++ Directories. Fill in the include directory ("c:\My Documents\include") under the Include Files listbox, and the library directory ("c:\My Documents\lib") under the Library Files listbox. IMPORTANT: Put the new include and library paths on the TOP of the lists (to avoid it using dx3 for instance) UNLESS you are using VS.Net 2005. In that case, make sure the PlatformSDK include folder is at the top of the list. 3. Configuring ClanLib --------------------------------------------------------------------------- A freshly downloaded ClanLib source package will include a workspace/solution and project for either MSVC6 (configure.dsw), or Visual Studio .NET 2005 (configure-vs80.sln). This is a configuration tool that will generate the real ClanLib workspace and project files. If you are using Visual Studio .NET below 2005, use the configure.dsw file and answer yes to the conversion. You have to compile and run this wizard and answer its questions carefully. Incorrect information will give you problems during the compilation. After you've compiled the app, just run it from inside of the compiler. When the configure wizard asks me where to install the header and library files, I specify those paths from section 2 (C:\My Documents\include and C:\My Documents\lib). When this is done, open the ClanLib.dsw file if you are using Developer Studio 6, or the ClanLib.sln file if you are using .NET version. Answer Yes to convert the file to your MSVC version if prompted. 4. Compiling ClanLib --------------------------------------------------------------------------- After loading the ClanLib workspace, the project view will show many different projects; clanApp, clanCore, clanDisplay etc... Start with making clanCore the active project, if its not active already. You do this by right-clicking it, and select 'Set as Active Project'. Select Debug or Release in the toolbar. If you can't find this option anywhere, right click on the toolbar, and make sure Build is selected, and deselect the Build Minibar. Press F7 to compile the active project. You need to compile at least these projects: - ClanApp - ClanCore - ClanDisplay - ClanGL Optionally, you can compile the others if you need them. Batch Build is handy here. You'll get some warnings for the different projects, similar to: ddraw.lib(DDRAW.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in winmm.lib(WINMM.dll); second definition ignored GLU32.lib(GLU32.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in OpenGL32.lib(OPENGL32.dll); second definition ignored LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library Ignore these warnings, they are not important. For each library in ClanLib, we produce two .lib files, eg clanCore.lib and clanCored.lib. The first one is for release versions of your game, and the second is for debug versions. The debug version includes debugging information in the library itself (so if the lib crashes, you can see where in the source code it crashed). After a successful compilation of ClanLib, it will automatically run a batch file that will install all headers and lib files in the path you specified in the wizard. In my case, that is "c:\My Documents\lib" and "c:\My Documents\include". So the following files will be added: c:\My Documents\lib\clanCore.lib (release lib) c:\My Documents\lib\clanCored.lib (debug lib) c:\My Documents\lib\clanGL.lib c:\My Documents\lib\clanGLd.lib c:\My Documents\include\ClanLib\core.h c:\My Documents\include\ClanLib\gl.h ... 5. Testing ClanLib --------------------------------------------------------------------------- To have a look at some examples of various parts of ClanLib, open the Examples.dsw/.sln file in your ClanLib root directory. This was created after you ran the Configure application. Select any example, and compile it. You'll find examples covering most parts of the ClanLib API. Once you're done and ready for some coding, proceed to next section. 6. Creating applications with ClanLib --------------------------------------------------------------------------- Note that MSVC will know what .lib file to link into your application, based upon the ClanLib headers you include in your application. Example: If you include then depending on whether you are building release or debug binaries the clanCore.lib or clanCored.lib library will be automatically linked into your executable. If you use Visual Studio Express, you need to include some additional libraries, user32.lib gdi32.lib and ole32.lib. Put them in the Additional Dependencies under the Linker setting in your project settings. 7. Creating a workspace for your application --------------------------------------------------------------------------- 1. Select File->New... 2. Select Projects->Win32 Application, and specify where you want it located. 3. Select "An empty project", and press OK till you're finished with the wizard. 4. Select Project->Settings... Notice there are several configurations in which you can modify settings. Normally, these are 'Win32 Debug' and 'Win32 Release'. You switch between these in the 'Settings for:' droplist. In section 5 and 6 below, you need to modify both these settings (sections a for release setting, and sections b for debug settings). 5. Select the 'C/C++' tab, and then Category 'Code Generation' 5a. For Release version, change the 'Use run-time library' to Multithreaded. 5b. For Debug version, change the 'Use run-time library' to Debug Multithreaded. 6. Select Project->Add To Project->New... 7. Select C++ Source File, and enter a name for the file, for example 'app.cpp' 8. Enter a skeleton for your code: #include #include #include #include class MyApp : public CL_ClanApplication { public: virtual int main(int argc, char **argv) { // Create a console window for text-output if not available // Use printf or cout to display some text in your program CL_ConsoleWindow console("Console"); console.redirect_stdio(); try { // Initialize ClanLib base components CL_SetupCore setup_core; // Initialize the ClanLib display component CL_SetupDisplay setup_display; // Initialize the ClanLib GL component CL_SetupGL setup_gl; // Create a display window CL_DisplayWindow window("ClanLib application", 640, 480); // Run until someone presses escape while (!CL_Keyboard::get_keycode(CL_KEY_ESCAPE)) { // Clear the display in a dark blue nuance // The four arguments are red, green, blue and alpha (defaults to 255) // All color nuances in ClanLib are measured in the interval 0->255 CL_Display::clear(CL_Color(0, 0, 50)); // Flip the display (using a double-buffer), // showing on the screen what we have drawed // since last call to flip() CL_Display::flip(); // This call updates input and performs other "housekeeping" // Call this each frame // Also, gives the CPU a rest for 10 milliseconds to catch up CL_System::keep_alive(10); } } // Catch any errors from ClanLib catch (CL_Error err) { // Display the error message std::cout << err.message.c_str() << std::endl; } // Display console close message and wait for a key console.display_close_message(); return 0; } } app; 8. Problems ? --------------------------------------------------------------------------- Please read the FAQ on http://clanlib.org for common errors and explanations, or ask in the Forums. -- Enjoy, The ClanLib development team clanlib-1.0~svn3827/configure.cbp0000644000175000017500000000413611256452575017350 0ustar bdefreesebdefreese clanlib-1.0~svn3827/configure.bpr0000644000175000017500000000730111256452575017364 0ustar bdefreesebdefreese [Version Info] IncludeVerInfo=0 AutoIncBuild=0 MajorVer=1 MinorVer=0 Release=0 Build=0 Debug=0 PreRelease=0 Special=0 Private=0 DLL=0 Locale=1033 CodePage=1252 [Version Info Keys] CompanyName= FileDescription= FileVersion=1.0.0.0 InternalName= LegalCopyright= LegalTrademarks= OriginalFilename= ProductName= ProductVersion=1.0.0.0 Comments= [HistoryLists\hlIncludePath] Count=5 Item0=Setup\Borland;..\..\..\Projects;Setup\Generic;$(BCB)\include;$(BCB)\include\vcl Item1=Setup\Borland;..\..;Setup\Generic;$(BCB)\include;$(BCB)\include\vcl Item2=..\..\..\..\..\Projects;..\Generic;$(BCB)\include;$(BCB)\include\vcl Item3=..\..\..\..;..\Generic;$(BCB)\include;$(BCB)\include\vcl Item4=..\Generic;$(BCB)\include;$(BCB)\include\vcl [HistoryLists\hlLibraryPath] Count=5 Item0=Setup\Borland;..\..\..\Projects;Setup\Generic;$(BCB)\lib\obj;$(BCB)\lib Item1=Setup\Borland;..\..;Setup\Generic;$(BCB)\lib\obj;$(BCB)\lib Item2=..\..\..\..\..\Projects;..\Generic;$(BCB)\lib\obj;$(BCB)\lib Item3=..\..\..\..;..\Generic;$(BCB)\lib\obj;$(BCB)\lib Item4=..\Generic;$(BCB)\lib\obj;$(BCB)\lib [HistoryLists\hlDebugSourcePath] Count=1 Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] Count=2 Item0=_DEBUG;WIN32 Item1=_DEBUG [HistoryLists\hlFinalOutputDir] Count=4 Item0=..\..\ Item1=..\..\..\ Item2=C:\Program Files\Borland\CBuilder5\Projects\Libs\ClanLib-0.5\ Item3=C:\Program Files\Borland\CBuilder5\Projects\Libs\ClanLib-0.5 [Debugging] DebugSourceDirs=$(BCB)\source\vcl [Parameters] RunParams= HostApplication= RemoteHost= RemotePath= RemoteDebug=0 [Compiler] ShowInfoMsgs=0 LinkDebugVcl=0 LinkCGLIB=0 [CORBA] AddServerUnit=1 AddClientUnit=1 PrecompiledHeaders=1 clanlib-1.0~svn3827/INSTALL.borland0000644000175000017500000001275211256452575017355 0ustar bdefreesebdefreeseBorlandC++ 5 Install instructions. Written by Mark Page. Last modified February 28, 2002 by Craig Timpany THIS FILE IS NOT BEING MAINTAINED. IF YOU DISCOVER SOMETHING IS WRONG, PLEASE TRY TO FIGURE IT OUT AND SEND US A PATCH. Building ClanLib =========================================================================== If you have the Borland C++Builder then simply compile and run configure.bpr. If some Borland packages seem to be missing: If you have the standard version of the Borland IDE you may need to disable the use of runtime packages in order to get it working. Go to Project->Options and select the Packages tab. Then disable the lowerst option ('Compile with runtime packages', should be the name, I tried to translate) If you have the commmand line tools then 'make -f configure.mak'. Run Configure, this creates the necessary directories and files. Then simply open the appropriate Borland/*.bpr file and start building. To build specific projects either use C++Builder or use make. It is suggested that you build App, Core and Display at the very minimum. The config program will ask if you have TASM, Borland's assembler. The Free-tools do *not* have it. In the Borland directory are makefiles and C++Builder project files. Either will build the project. The files with an extra 'd' on the end builds the debug versions. If you just want to build ClanLib quickly then I suggest you use the makefiles. They are faster (you don't need to have BCB loaded) and won't crash your computer. The makefiles assume you have Hermes and zlib includes in your $(BCB)\include dir so it looks like this: ($(BCB) being where you install borland c++) $(BCB)\include\zlib.h $(BCB)\include\zconf.h $(BCB)\include\Hermes\Hermes.h $(BCB)\include\Hermes\H_Blit.h $(BCB)\include\Hermes\H_Clear.h $(BCB)\include\Hermes\H_Config.h $(BCB)\include\Hermes\H_Conv.h $(BCB)\include\Hermes\H_Format.h $(BCB)\include\Hermes\H_Pal.h $(BCB)\include\Hermes\H_Types.h To run a makefile from DOS, type 'make -f whatever.mak'. There is no master makefile, you'll need to do this individually for each ClanLib module you need. You need zlib.lib and hermes.lib to create complete applications, however you don't need them to compile ClanLib. You can build them from source but they MUST be multi-threaded (use -tWM) or else you'll get weird crashes. Check out clanlib.org for pre-built binaries of these libraries. Compiling Apps with ClanLib =========================================================================== 1. You must compile your program the -tWM flag. This enables multi-threading (ClanLib is multi-threaded). 2. You must link with cw32mt.lib and not cw32.lib. You also need to link to zlib.lib, hermes.lib and libapp.lib you may also have to link with other libraries(eg Clanlib libdisplay.lib) and almost certainly the directX libs (dinput.lib, ddraw.lib). You can't use the user run-time DLLs of DirectX for this, you need the SDK. If you only have free command-line borland, you probably have headers, but not libraries. Converting the MS DirectX libraries to ones Borland can use is reputed to be difficult, so you might have to find a package of Borland .libs somewhere on the net. At the time of writing, there were some here: http://www.geocities.com/foetsch/borland_dx8_libs.zip Don't worry if you can't find the latest version, as far as I know, Clanlib only uses very basic DirectX features (circa DirectX 3). There are external libraries that you may need as well (libPNG, etc...). 3. You must place a directory called ClanLib somewhere in your header search path. I recommend placing it in $(BCB)\include\. Then simply copy the files under ClanLib\Sources\API to $(BCB)\include\ClanLib\. If you do this properly then $(BCB)\include\ClanLib\ should be populated with files such as ttf.h, core.h, display.h and app.h. There should also the appropriate subdirectories for each. 4. Depending on which external libraries you link with(Hermes-dynamic, Hermes-static...) then you might have to include the .def files for the project into your application. This is required when using Hermes-dynamic(Hermes.lib/Hermes.dll). If your app doesnt work with the supplied .libs you may need to compile them yourself. See above for instructions. Firstly only compile libApp.lib, libClan.lib and libDisplay.lib and see whether it works then. Don't forget to use your self compiled libraries for your project after that ! (Project->Remove from project to remove the downloaded ones and Project->Add to project to add your self compiled ones). You can find your self-compiled libraries in \Release for release libraries and \Debug for debug versions (the ones with a 'd' at the end). For those with command-line tools, here's an example makefile: =========================================================================== OBJS = mysourcefilename.obj anotherfile.obj andsoon.obj CPP = bcc32 LINKER = ilink32 CCOPTS = -tWM DEBUG = -v -k LDEBUG = /v CPPFLAGS= -jb $(CCOPTS) $(DEBUG) -DHAVEMIKMOD LINKFLAGS= /aa /Tpe $(LDEBUG) c0w32.obj LINKLIBS=zlib.lib hermes.lib \ ddraw.lib dinput.lib \ libapp.lib libdisplay.lib libcore.lib \ import32.lib \ cw32mt.lib all: $(OBJS) $(LINKER) $(LINKFLAGS) $(OBJS), acmegame.exe, , $(LINKLIBS) # cpp -> obj: .cpp.obj: $(CPP) $(CPPFLAGS) -c {$? } Known Issues =========================================================================== - The define BORLAND must be set in all your programs or else they won't compile at all. Report bugs to plasmoid@shaw.ca and clanlib-devel@dark.x.dtu.dk. clanlib-1.0~svn3827/configure-vc90.sln0000644000175000017500000000157011256452575020156 0ustar bdefreesebdefreeseMicrosoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Configure-vc90", "configure-vc90.vcproj", "{8BCDB55D-033B-44F3-A955-AA93AC83142A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8BCDB55D-033B-44F3-A955-AA93AC83142A}.Debug|Win32.ActiveCfg = Debug|Win32 {8BCDB55D-033B-44F3-A955-AA93AC83142A}.Debug|Win32.Build.0 = Debug|Win32 {8BCDB55D-033B-44F3-A955-AA93AC83142A}.Release|Win32.ActiveCfg = Release|Win32 {8BCDB55D-033B-44F3-A955-AA93AC83142A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal clanlib-1.0~svn3827/INSTALL.macosx0000644000175000017500000002270211256452575017222 0ustar bdefreesebdefreese--------------------------------------------------------------------------- Building ClanLib on Mac OS X --------------------------------------------------------------------------- 1. Getting Started 2. Building ClanLib 3. Running Example Applications 4. Creating Applications with ClanLib 5. Universal Binaries 6. F.A.Q. 7. Problems? 1. Getting Started --------------------------------------------------------------------------- The ClanLib Xcode project file was created with Xcode 1.5, so download and install that (or something newer) before continuing. NOTE: Xcode v2.2 projects are now also included as "Clanlib_Xcode_v2x.xcodeproj" In order to build ClanLib, you need to locate a few dependencies. The required frameworks depend upon which ClanLib modules you will build. You will most likely require at least libjpeg and libpng as ClanDisplay requires those frameworks and several other ClanLib components require ClanDisplay. The available external frameworks are: - libjpeg - libpng - mikmod - Ogg - SDL - Vorbis With the likely exception of libjpeg and libpng, the source code and Xcode project files for each of these frameworks can be found at their respective websites (use Google). To make things easier, all of them have been pre-built and collected at these URLs for easy downloading: - Mac OS X 10.4+ Universal (PowerPC + Intel): - http://www.clanlib.org/download-binaries-osx-gcc40-universal.html - Mac OS X 10.4+ PowerPC Only: - http://www.clanlib.org/download-binaries-osx-gcc40.html - Older Mac OS X PowerPC Only: - http://www.clanlib.org/download-binaries-osx-gcc33.html Once you have all of the external frameworks collected, place them into a "Frameworks" folder in your "ClanLib-0.8" folder (the same folder that the ClanLib.xcode project file is in) as this is where the ClanLib Xcode project expects them to be. You will have to create this folder manually. If you want them somewhere else, then you will have to point the way to Xcode - in which case you are on your own. :-) 2. Building ClanLib --------------------------------------------------------------------------- Now that you've installed Xcode and got the other frameworks, go ahead and open the ClanLib.xcode project file. (If you are using a newer version of Xcode it will prompt to upgrade the project file - do it.) The project file contains several targets which build each component of ClanLib as a separate framework. These resulting frameworks are private frameworks which are meant to be copied/embedded into the bundle for the application you are creating. This means your finished application will be self-contained as far as ClanLib is concerned and not require installation of any components onto end-user machines. Select the ClanLib target in the Xcode project and hit build. The resulting frameworks are placed into a "MacOSX" folder within the same folder as the ClanLib.xcode file itself resides. Inside this folder you will find all required frameworks that are both part of ClanLib as well as the required external frameworks. This should make it easy to see exactly what you will need to bundle with your application. If you don't need all of the modules (for instance, if you have no need for ClanSDL and ClanMikMod), then simply edit the "ClanLib Distro" target and delete the references to the targets you do not need. Don't forget to look in the "Copy Files (MacOSX)" build phase as well! 3. Running Example Applications --------------------------------------------------------------------------- The "Examples" folder has another Xcode project file named Examples.xcode. This project has most (but not all) of the ClanLib example applications pre-built as targets for easy testing. Simply set the active target to the example you wish to try and hit build. The project file expects the ClanLib frameworks to be in the "ClanLib-0.8/MacOSX/" folder which is where the ClanLib.xcode project you used in step #2 places them. 4. Creating Applications with ClanLib --------------------------------------------------------------------------- Now that you've got ClanLib and the modules you need built, it is time to use them! Create an Xcode project however you like. (The Carbon Application template is probably what you will want for now.) Then add the frameworks you will need to your project - remember they are in the "MacOSX" folder as mentioned in step 2 above. You will *always* need the ClanLib.framework as well as any others you may have used (most certainly ClanCore.framework). Don't forget to add the external frameworks that may be required by the ClanLib components you are using! (These are libjpeg, libpng, etc. which should have been copied into the "MacOSX" folder mentioned earlier and are required by ClanDisplay.framework.) When adding external frameworks, Xcode should automatically set your target to link with them. You can check to make sure by opening the "Link Binary With Libraries" folder under your target and verifying that they are represented there. If not, simply drag them into the folder. The final preparation step is to add a "Copy Files" build phase to your target. Set the location to "Frameworks" and then drag the various ClanLib and required external frameworks (such as libjpeg and libpng) into the build phase's folder. This will cause Xcode to copy those frameworks directly into your application's bundle and result in a self-contained binary which needs no installer. You do not need to copy in CoreServices, Carbon, libstdc++, or any other frameworks or libraries that were automatically added by the new project template (such as Carbon Application) when you created the new project file with Xcode as they are always included with Mac OS X. After your project file is prepared, add your source files and click build. With luck it will all just work. 5. Universal Binaries --------------------------------------------------------------------------- As you know, universial binaries will execute natively on PowerPC and Intel based Macs using the same application bundle. This means that you can easily deploy Mac applications to users of both types of machines and be sure that each user enjoys the performance they expect from their platform. Building a universal version of your ClanLib application is easy and should only require a few changes to your Xcode project file as well as ClanLib's project file. You must have Xcode 2.2 or newer in order for this to work as well as universal versions of the required frameworks copied into your "Frameworks" folder (as talked about above). Additionally, it is important that if you have previously built ClanLib *without* using the universal frameworks, you must remove the non-universal frameworks from the "MacOSX" folder that the ClanLib build process created (as was described above). Sometimes Xcode doesn't notice that the new universal frameworks have changed from the old and so they don't get replaced which can cause problems if your project file refers to that "MacOSX" folder directly (as is the case with the Examples Xcode project file provided in the ClanLib "Examples" folder). Since you should already have Xcode 2.2 or higher, you've likely already opened and upgraded a copy of the ClanLib.xcode project file. If not, do so. Be sure to tell Xcode to save the upgraded project file in the same folder as the original ClanLib.xcode file (which it should do by default). Once Xcode is open and the ClanLib project file is loaded, click on the "Project" menu followed by the "Edit Project Settings" option. The project settings editor should pop up. First switch to the "General" tab. There should be an option labled "Cross-Develop Using Target SDK" with a drop down menu. The menu likely reads something like "Current Mac OS." Change that to "Mac OS X 10.4 (Universal)." Switch to the "Build" tab and look for the setting named "Architectures". Select it and click "Edit" and check the boxes for both Intel and PowerPC and click OK. Now rebuild ClanLib. It will take awhile since it'd building for two, now. Once ClanLib has been built, simply make those same two changes to your own project file and make sure it is refering to the now universal ClanLib and supporting frameworks and rebuild your application. Once the build is done you will have a complete universal application bundle that will run on both PowerPC and Intel based Macs with OS X 10.4 or later. Of course to be safe you should test the end product on both architectures before your final deployment. 6. F.A.Q. Q: My try/catch doesn't seem to be able to catch CL_Error throws, instead I just get a segfault! A: Due to changes to default visibility attributes in gcc 4.0 it is necessary to make the following changes to the XCode 1.5 project after upgrading it to v2.2+ (ClanLib and your app's): Look for "Symbols Hidden By Default" and set it to unchecked. If it's already unchecked, check it and uncheck it anyway, so it will override whatever the default is. That may be all that is needed, but perhaps you need Inline Functions Hidden unchecked as well, not sure, something to try if you have any problems. (these settings have already been applied to the ClanLib Xcode 2.2 projects) 7. Problems? --------------------------------------------------------------------------- Please read the FAQ on http://www.clanlib.org/ for common errors and explanations. There is also a Wiki at http://www.clanlib.org/wiki/. If you cannot find the answer to your problem in the FAQ, feel free to ask on the ClanLib user mailing list or join the #clanlib channel on IRC at irc.freenode.net. -- Enjoy, The ClanLib development team clanlib-1.0~svn3827/PATCHES0000644000175000017500000000174611256452575015717 0ustar bdefreesebdefreeseDue to the modest volume of patches we get and because all recent patches that have come in are rather hairy, here is a summary of how to create patches for ClanLib. Diffing =================================== Use 'diff -u > mypatch.patch' or 'svn diff > mypatch.patch' from within the ClanLib (trunk) directory. This is contextual diff, it provides more information so it easier to examine the changes before applying. If you're using Windows, the TortoiseSVN utility (http://tortoisesvn.tigris.org/) can easily create patches. Right click your ClanLib directory (or trunk), and select TortoiseSVN->Create Patch. Submitting =================================== Please submit patches to our Developer Chat section on the forums: http://www.rtsoft.com/forums/forumdisplay.php?f=16 Describing =================================== You should describe what your patch does. Please no 'This fixes a bug'. Tell us which bug, in what component. Generally, be descriptive without being needless verbose. clanlib-1.0~svn3827/README.upgrade0000644000175000017500000006513211256452575017212 0ustar bdefreesebdefreeseThis document describes how to port your game from an old ClanLib version to a new one. Upgrading from 0.7.8 to 1.0.0 ============================= 1. CL_InputEvent changes ------------------------ CL_InputEvent::right/left_alt/shift/ctrl got removed, use this to check if they are pressed instead: CL_Keyboard::get_keycode(CL_KEY_LSHIFT) // (CL_KEY_LCONTROL, CL_KEY_RCONTROL, etc) 2. CL_Surface changes --------------------- The CL_Surface_DrawParams got turned into references (they were pointers before): void draw( const CL_Surface_DrawParams1& params1, CL_GraphicContext *context = 0); void draw( const CL_Surface_DrawParams2& params2, CL_GraphicContext *context = 0); 3. CL_PixelBuffer changes ------------------------- CL_PixelBuffer is a ref_counted class, thus its no longer needed to manully keep track of the ownership, so all calls which took CL_PixelBuffer* have been changed to use CL_PixelBuffer instead: CL_Surface(CL_PixelBuffer*, bool delete_provider); was changed to CL_Surface(CL_PixelBuffer); 4. sig_key_dblclk() is gone --------------------------- If you need it, you have to emulate it now yourself via sig_key_down() and CL_System::get_time(). 5. CL_InputDevice::keyid_to_string(const std::string &str) --------------------------------------------------------------------- We renamed a function here to more sense what it actually does: int CL_InputDevice::keyid_to_string(const std::string &str) const; is now called int CL_InputDevice::string_to_keyid(const std::string &str) const; 6. ClanGUI clipping and translation changes ------------------ For performance reasons, GUI components do no longer automatically add translation and clipping to the drawing area. If you have a CL_Component and use sig_paint(), you can get the absolute screen coordinates by calling: CL_Rectf rect = component->get_screen_rect(); If you want to have a clipping section around your component use: component->set_clipping(true); 7. ClanGUI CL_Window buttons ---------------------------- If you want to hook into the close buttons of windows, use CL_Window::sig_close_button_clicked() instead of sig_close(). Also have a look at the GUIWindow example to see how you define which buttons go on the titlebar. Upgrading from 0.7.7 to 0.7.8 ============================= 1. Canvas changes ----------------- Instead of using surface.get_gc() to get a surface canvas, you now create a CL_Canvas object. Example: CL_Surface surface_foo("foo.png"); CL_Surface surface_bar("bar.png"); CL_Canvas canvas(surface_foo); surface_bar.draw(5, 5, canvas.get_gc()); Check the new Canvas example, and the API reference for more information. 2. Surface changes ------------------ The Hint parameter to surface construction was removed. 3. Module initializations ------------------------- To initialize ClanLib modules, you call CL_SetupCore::init(), CL_SetupDisplay::init(), etc for each module. ::deinit() to de-initialize them. This can cause problems, since in some cases objects on the stack are deleted after the deinit of ClanLib modules. So, we have added some new initialization classes to help remedy this problem. CL_SetupCore::init(); -> CL_SetupCore setup_core; CL_SetupDisplay::init(); -> CL_SetupDisplay setup_display; CL_SetupNetwork::init(); -> CL_SetupNetwork setup_network; etc, for all modules. There is no deinit in this new case. If you have problems with crashes on shutdown, try to use this alternative initialization. 4. TargaProvider changes ------------------------ The internal format of images provided by the Targa loader changed. Make sure you don't make any assumptions of the formats returned by the image providers. Check the format using get_format(), and its functions get_red/green/blue/alpha_mask(). Upgrading from 0.7.6 to 0.7.7 ============================= 1. OpenGL state changes ----------------------- Instead of begin_3d() / end_3d(), we now have a new method of synchronizing the OpenGL state between ClanLib and your own custom OpenGL code. Please read the new OpenGL Overview on how to use this new class. 2. CL_Component signal changes ------------------------------ sig_get_minimum_size / sig_get_maximum_size / sig_get_preferred_size These signals in CL_Component changed from CL_Point to CL_Size, so if you have a custom theme make sure you change the signal function to void ...::on_get_preferred_size(CL_Size &size) Note that CL_Size has width and height, compared to CL_Points x and y. 3. CL_Window construction changes --------------------------------- Previously, a CL_Window would always make itself a root component in the GUI hierarchy, no matter what parent component you specificed in its constructor. We've changed this behaviour to make it use the parent you give in its constructor. This way a CL_Window behaves the same as all other components, and also makes it possible to create MDI apps. To make sure your windows are root components, use get_gui_manager() as the parent. In most cases this is probably what you already do, or the parent IS the root component, so any changes will normally not be required. Upgrading from 0.7.5 to 0.7.6 ============================= No changes needed. Upgrading from 0.7.4 to 0.7.5 ============================= 1. ClanGUI changes ------------------ 1a. XML used for GUI To complete our transition away from proprietary formats, we have now moved the last part over to XML - the GUI definition files. GUI definition example of the old format: window my_window { x = 10; y = 10; width = 600; height = 400; title = "My Window"; button my_button { text = "My Button"; x = 25; y = 130; width = 100; height = 20; } } The same defintion in the new format: