• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..07-May-2022-

docs/H03-May-2022-

INSTALLH A D03-May-20221.7 KiB7353

LICENSEH A D03-May-202225.8 KiB505418

Makefile.amH A D03-May-2022322 1914

Makefile.confH A D03-May-20221.5 KiB6440

Makefile.inH A D03-May-202216.5 KiB547471

READMEH A D03-May-20227.8 KiB220152

TodoH A D03-May-2022158 84

WhatsNewH A D03-May-20228.9 KiB225185

sge.hH A D03-May-2022852 3213

sge_blib.cppH A D03-May-202244.8 KiB1,9401,339

sge_blib.hH A D03-May-20224.2 KiB6939

sge_bm_text.cppH A D03-May-202212.9 KiB452291

sge_bm_text.hH A D03-May-20222.5 KiB7241

sge_collision.cppH A D03-May-20228.2 KiB389275

sge_collision.hH A D03-May-20221.7 KiB5530

sge_config.hH A D03-May-2022137 64

sge_internal.hH A D03-May-20223.7 KiB15377

sge_misc.cppH A D03-May-20222.6 KiB9342

sge_misc.hH A D03-May-2022945 3816

sge_primitives.cppH A D03-May-202269.5 KiB2,5171,680

sge_primitives.hH A D03-May-202210 KiB11284

sge_rotation.cppH A D03-May-202220.9 KiB684455

sge_rotation.hH A D03-May-20221.7 KiB4721

sge_shape.cppH A D03-May-202216.7 KiB763584

sge_shape.hH A D03-May-202211.6 KiB366174

sge_surface.cppH A D03-May-202232.5 KiB1,091680

sge_surface.hH A D03-May-20224.7 KiB10164

sge_textpp.cppH A D03-May-202215.8 KiB786528

sge_textpp.hH A D03-May-20227.6 KiB271141

sge_tt_text.cppH A D03-May-202240.7 KiB1,457941

sge_tt_text.hH A D03-May-20225.1 KiB11567

README

1SDL Graphics Extension (SGE)
2====================================================================================
3http://freshmeat.net/projects/sge/
4http://www.etek.chalmers.se/~e8cal1/sge/index.html
5http://www.digitalfanatics.org/cal/sge/index.html
6
7Author: Anders Lindstr�m - email: cal@swipnet.se
8
9
101. Intro
112. Requirements
123. Compiling
134. Library usage
145. Makefile options
15   5.1 Using pure C with SGE (C_COMP)
16   5.2 FreeType (USE_FT)
17   5.3 The SDL_Image library (USE_IMG)
18   5.4 The QUIET option (QUIET)
196. Cross compiling SGE to W32
207. Compiling SGE under W32 with MS VisC/C++
218. Thanks
229. Misc.
23
24
25====================================================================================
261. Intro
27
28SGE is an add-on graphics library for the Simple Direct Media Layer. SGE provides
29pixel operations, graphics primitives, FreeType rendering, rotation/scaling and much
30more.
31
32This is free software (LGPL), read LICENSE for details.
33
34SGE has the following parts:
35[sge_surface]    Pixel operations, blitting and some pallete stuff.
36[sge_primitives] Drawing primitives.
37[sge_tt_text]    FreeType font support.
38[sge_bm_text]    Bitmapfont and SFont support.
39[sge_textpp]     Classes for handling and rendering text.
40[sge_shape]      Classes for blitting and sprites.
41[sge_collision]  Basic collision detection.
42[sge_rotation]   Rotation and scaling of surfaces.
43[sge_blib]       Normal, filled, gourand shaded and texture mapped polygons.
44[sge_misc]       Random number and delay functions.
45
46
47Read docs/index.html for API documentation.
48
49Always check WhatsNew for important (API) changes!
50
51There is a "Beginners guide to SGE" in the html documentation about how to compile and
52use SGE in your own project, please read it if you're new to Unix/Linux development.
53
54Read INSTALL for quick compile and install instructions.
55
56
57====================================================================================
582. Requirements
59
60-GNU Make.
61-SDL 1.2+.
62-An ANSI/ISO C++ compiler. SGE should conform to ANSI/ISO C++.
63-Optional:
64 -FreeType 2+
65 -SDL_Image (see section 5.3)
66-Some SDL knowledge.
67
68First you need SDL (http://www.libsdl.org/) and the FreeType (2.x) library
69at http://www.freetype.org/ (you only need the FreeType library if you want
70to use SGE's truetype font routines, see section 5.2). The FreeType library is
71included in most Linux distributions (RPM users: install the freetype dev rpm
72package from the install cd).
73
74After installing SDL and FreeType, don't forget to check that the dynamic
75linker can find them (check /etc/ld.so.conf and run ldconfig).
76
77You must also have a good C++ compiler (should be able to handle templates). Recent
78versions of GNU c++ works fine. SGE will use gcc/g++ as default, but this can be
79changed in the file "Makefile.conf".
80
81
82====================================================================================
833. Compiling
84
85Before compiling you might want to change some Makefile.conf options, see section 5.
86
87Just do 'make install' to compile and install SGE. This will install SGE to the same
88place as SDL. You can change the install location by editing the PREFIX and PREFIX_H
89lines in the file "Makefile.conf".
90
91If you just want to test the examples (and not install anything) you can just do
92'make'. This will build a static version of SGE (libSGE.a).
93
94If you want a dynamic version of SGE (libSGE.so) but don't want the makefile to
95install SGE, do 'make shared'.
96
97To build the examples, goto the directory examples/ and do 'make'.
98
99See the file INSTALL for more information. You can also read the file
100"docs/guide.html"
101
102
103====================================================================================
1044. Library usage
105
106Do "#include "sge.h"" in your code after the normal "#include "SDL.h"" line.
107
108The normal way to compile code that uses SGE is with the flag
109"`sdl-config --cflags`", but also add the flag "-I/path/to/SGE/headers" if the SGE
110headers are installed at any other place than the SDL headers.
111
112The normal way to link code that uses SGE is with the flags
113"-lSGE `sdl-config --libs` -lstdc++", but also add the flag "-L/path/to/SGE/library"
114if SGE is installed at any other place than SDL. If you're using static linking then
115the flags "`freetype-config --libs`" and/or "-lSDL_image" also needs to be added if
116FreeType and/or SDL_Image support is enabled.
117
118Example:
119g++ -Wall -O3 `sdl-config --cflags` -c my_sge_app.cxx
120g++ -o my_sge_app my_sge_app.o -lSGE `sdl-config --libs` -lstdc++
121
122See "docs/guide.html" and the code in examples/ for more information.
123
124
125====================================================================================
1265. Makefile options
127
128Edit Makefile.conf to turn on/off (y/n) these options.
129
130
1315.1 Using pure C with SGE (C_COMP)
132
133Setting 'C_COMP = y' should allow both C and C++ projects to use SGE. However, you
134will not be able to use any of the overloaded functions (only the Uint32 color
135version of the overloaded functions will be available) or C++ classes from a C
136project. C++ projects should not be affected. Default is 'y'.
137
138
1395.2 FreeType (USE_FT)
140
141If you don't need the TT font routines or just don't want do depend on FreeType,
142uncomment 'USE_FT = n' in Makefile.conf. Default behavior is to autodetect
143FreeType.
144
145
1465.3 The SDL_Image library (USE_IMG)
147
148The SDL_Image library (http://www.libsdl.org/projects/SDL_image/index.html) will be
149autodetected with the default setting. SDL_Image support enables SGE to load png
150images and thus use Karl Bartel's very nice SFont bitmapfonts
151(http://www.linux-games.com/sfont/). The use of SDL_Image can also be controlled by
152setting 'USE_IMG = y/n' manually.
153
154
1555.4 The QUIET option (QUIT)
156Set 'QUIET = y' if you don't want the makefile to output any SGE specific messages.
157
158
159====================================================================================
1606. Cross compiling SGE to W32
161
162SGE can be compiled by a win32 crosscompiler. You need a crosscompiled version of
163SDL (and FreeType or SDL_Image if used). Check SDL's documentation (README.Win32) on how to get and setup
164a cross-compiler.
165
166A crosscompiler can be found at http://www.libsdl.org/Xmingw32/index.html. This
167crosscompiler uses the new MS C-Run-time library "msvcrt.dll", you can get it from
168www.microsoft.com/downloads (do a keyword search for "libraries update") if you
169don't already have it.
170
171If you want to build a dll ('cross-make dll' or 'dll-strip') then you might want to
172do 'ln -s ../../bin/i386-mingw32msvc-dllwrap dllwrap' in
173/usr/local/cross-tools/i386-mingw32msvc/bin.
174
175
176====================================================================================
1777. Compiling SGE under W32 with MS VisC/C++
178
179Should work. Check the download page on SGEs homepage for project files (these are
180untested by me and are often outdated but may be of some help).
181
182Note that if you don't use the makefile system to build SGE (as with VisC/C++) then
183you must edit sge_config.h manually to change build options. The options in section
1845 corresponds to defining the following symbols in sge_config.h:
185_SGE_C_AND_CPP  - C_COMP=y
186_SGE_NOTTF      - USE_FT=n
187_SGE_HAVE_IMG   - USE_IMG=y
188
189For example:
190/* SGE Config header */
191#define SGE_VER 030809
192#define _SGE_C_AND_CPP
193#define _SGE_HAVE_IMG
194
195
196====================================================================================
1978. Thanks.
198
199Thanks goes to...
200-Sam Lantinga for the excellent SDL library.
201-The FreeType library developers.
202-John Garrison for the PowerPak library.
203-Karl Bartel for the SFont library (http://www.linux-games.com/).
204-Garrett Banuk for his bitmap font routines (http://www.mongeese.org/SDL_Console/).
205-Seung Chan Lim (limsc@maya.com or slim@djslim.com).
206-Idigoras Inaki (IIdigoras@ikerlan.es).
207-Andreas Schiffler (http://www.ferzkopp.net/Software/SDL_gfx-2.0/index.html).
208-Nicolas Roard (http://www.twinlib.org).
209
210and many more...
211
212====================================================================================
2139. Misc.
214
215Read the html documentation and study the examples.
216
217
218
219/Anders Lindstr�m - email: cal@swipnet.se
220