Starting.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <- Manual.html | Back to main page
  2. Title: Getting started
  3. ---
  4. Title2: Working in Linux
  5. Place the library's root folder inside of a new folder. This gives room for the temporary object's folder, which will be created outside of the dfpsr folder when compiling.
  6. Image: Images/Warning.png | Warning
  7. A light-weight Linux distribution for laptops (such as Linux Mint) might require you to install GNU's compiler toolchain <B>"gcc"</B> and X11 headers <B>"libx11-dev"</B>.
  8. Image: Images/Warning.png | Warning
  9. Big-endian support is only theoretical and has never actually been tested, because big-endian desktops were practically extinct when the library was created. If you happen to own such a rare museum item in working condition, sending the <B>DSR_BIG_ENDIAN</B> macro to compilation should activate the big-endian mode and shift the direction of bit shift meant to be equivalent with the address space.
  10. Title2: Build and run an example program:
  11. *
  12. Select an SDK example and open its folder in a terminal.
  13. *
  14. Give permission to execute the build script.
  15. <PRE><BLOCKQUOTE>chmod +x build.sh</BLOCKQUOTE></PRE>
  16. *
  17. Run the build script.
  18. <PRE><BLOCKQUOTE>./build.sh</BLOCKQUOTE></PRE>
  19. Title2: If no example runs, try regression tests to diagnose:
  20. *
  21. Open the source folder in a terminal and run the test script:
  22. <PRE><BLOCKQUOTE>chmod +x test.sh
  23. ./test.sh</blockquote></BLOCKQUOTE></PRE>
  24. This will stop with a clearly visible error message if any of the tests fail.
  25. Title2: Create your own project
  26. *
  27. Copy the folder of a template program.
  28. If you want a 3D application with animations, start from basic3D.
  29. If you want graphical user interface that only redrawn when something happens, start from basicGUI.
  30. If you want a command line interface application, start from basicCLI. Command line applications are more portable by using "WINDOW_MANAGER=NONE". This compiles the dummy wrapper NoWindow.cpp so that it can run on the pure operating system without any display server.
  31. *
  32. Change ROOT_PATH and TEMP_DIR in your build script to refer to the same locations from a new source path. If you don't use the build script, you can just delete it.
  33. *
  34. Update header include paths to the library from the new folder location.
  35. *
  36. Add your own external dependencies to LINKER_FLAGS within a quote with -l in front of each library name.
  37. ---
  38. Title2: Compiling a project on Microsoft Windows
  39. Create a project from existing code:
  40. *
  41. Download a mingw edition of CodeBlocks from their website. <A href="http://www.codeblocks.org/downloads/26#windows">www.codeblocks.org/downloads</A>
  42. *
  43. Start CodeBlocks with administrator rights and create a new Win32 project, just to get the correct libraries. You can then throw away the template main file.
  44. *
  45. If not starting as an administrator, certain parts of the file system may lack necessary permissions needed for creating executable binaries.
  46. *
  47. Select C++ 14 with G++ from the GCC toolchain, so that it will be compatible with the software renderer. Link with "-lm -pthread" to get standard C++ math and threading. This should be done for both debug and release.
  48. *
  49. Import all source files from <B>dfpsr/Source/DFPSR</B>.
  50. *
  51. Import all source files from <B>the project you want to build</B>.
  52. *
  53. Import <B>dfpsr/Source/windowManagers/Win32Window.cpp</B>.
  54. *
  55. Save your project, so that you can continue working on the project.
  56. *
  57. Build and run the project.
  58. This is not an ideal solution for development if you plan to have multiple projects depending on the same library. A better solution would be to compile the whole dfpsr folder into a static library, link to it in each of your projects and refer to includeFramework.h.
  59. ---