diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 320412a..42f1129 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,11 +1,17 @@ Changelog for Photon -$Id: CHANGELOG.txt,v 1.12 2005/08/23 21:55:03 cozman Exp $ +$Id: CHANGELOG.txt,v 1.13 2005/11/13 07:59:48 cozman Exp $ ! : Major Changes (potentially breaking existing code) + : New Features * : Minor Changes (bugfixes and behind-the-scenes changes) 0.1.0 + * Major documentation sweep, much more useful for casual users. Also fixed + tons of documentation mismatches. + * Fixed bug where app would hang if run() was called with no active state or + before the display was created. + * Changed AudioCore to be pure virtual with OALAudioCore implementing it. + * Fixed issues with OpenAL 1.1 new types. * Rewrote circle drawing code in Pen, major speed up. 0.0.2 - Released 2005-18-08 diff --git a/LIBRARIES.txt b/LIBRARIES.txt index b30c418..b86cbc8 100644 --- a/LIBRARIES.txt +++ b/LIBRARIES.txt @@ -1,8 +1,9 @@ -$Id: LIBRARIES.txt,v 1.1 2005/07/20 21:56:33 cozman Exp $ +$Id: LIBRARIES.txt,v 1.2 2005/11/13 07:59:48 cozman Exp $ Photon uses several other libraries, which fall under a variety of licenses: GLFW - http://glfw.sourceforge.net/ - zlib license +Boost - http://boost.org/ - Boost Software License PhysFS - http://icculus.org/physfs/ - zlib license Corona - http://corona.sourceforge.net/ - zlib license Freetype2 - http://freetype.org/ - Freetype License (FTL) @@ -20,11 +21,14 @@ uses photon and it's dependencies you must do the following: 1) To satisfy the zlib license that photon and most of the other libs use, you simply must not claim you wrote them & not remove the zlib license in license.txt, also any changes must be marked if that applies to you. - 2) To comply with the Freetype license you must not claim you wrote it, + 2) Complying with the Boost Software License is the easiest, if distributing + Boost source code, you must include the BSL, if distributing object + code (eg. library or executable) nothing actually needs to be done. + 3) To comply with the Freetype license you must not claim you wrote it, but you must also give credit to the authors. The credit clause is the only real difference between the Freetype License and the zlib license. - 3) If you are using OpenAL, you are most likely dynamically linking (using + 4) If you are using OpenAL, you are most likely dynamically linking (using a .dll or .so) which means that in order to comply with the LGPL you must: Make it clear that you are using OpenAL in your credits file, include a copy of the LGPL with any binaries, provide a link to the @@ -45,13 +49,15 @@ libraries which isn't necessary but I feel it's proper.) This application uses Photon which is available from http://photon.sourceforge.net/ and is licensed under a zlib license. -Photon (and this application) uses several other zlib-licensed libraries: - GLFW - http://glfw.sourceforge.net/ - PhysFS - http://icculus.org/physfs/ - Corona - http://corona.sourceforge.net/ -Photon (and this application) also uses Freetype2 which is licensed under the - Freetype license. -Photon (and this application) also uses OpenAL which is licensed under the LGPL - To comply with the LGPL a copy of a copy of the LGPL is provided in this - directory as LGPL.txt. A copy of the OpenAL source is available from - http://openal.org/ +Other libraries used indirectly or directly by this program include: + GLFW - http://glfw.sourceforge.net/ - zlib license + Boost - http://boost.org/ - Boost Software License + PhysFS - http://icculus.org/physfs/ - zlib license + Corona - http://corona.sourceforge.net/ - zlib license + Freetype2 - http://freetype.org/ - Freetype License (FTL) + OpenAL - http://openal.org/ - LGPL + +To comply with the LGPL a copy of a copy of the LGPL is provided in this +directory as LGPL.txt. + +A copy of the OpenAL source is available from http://openal.org/ diff --git a/README.txt b/README.txt index 806200a..2cae447 100644 --- a/README.txt +++ b/README.txt @@ -4,10 +4,10 @@ accelerated 2D games with OpenGL and other open source & cross platform libraries. Photon aims to simplify portable game development, enabling developers to focus on the gameplay. Photon uses OpenGL for hardware accelerated rotation, alpha blending, resizing, and drawing. Photon is built entirely on -free software, using libraries like GLFW, PhysFS, OpenAL, and boost. Using -Photon does not require knowledge of any of these libraries as their needed -functionality is wrapped entirely within Photon’s rich class library so that -anyone with a decent grasp of C++ can use Photon. +free software, using libraries including including GLFW, PhysFS, OpenAL, Corona, +Freetype and boost.. Using Photon does not require knowledge of any of these +libraries as their needed functionality is wrapped entirely within Photon’s rich +class library so that anyone with a decent grasp of C++ can use Photon. photon is a cross platform API, designed primarily for game development. photon is designed to run on as many operating systems as possible, and OS support is only limited by libraries which Photon depends on, at the moment @@ -27,4 +27,4 @@ with your applications. If you need any help or have any questions check out IFAQ.txt or visit photon's homepage at http://photon.sourceforge.net/. -$Id: README.txt,v 1.1 2005/07/17 22:41:03 cozman Exp $ +$Id: README.txt,v 1.2 2005/11/13 07:59:48 cozman Exp $ diff --git a/SConstruct b/SConstruct index 40dd3e9..cf765b8 100644 --- a/SConstruct +++ b/SConstruct @@ -5,7 +5,7 @@ # James Turk (jpt2433@rit.edu) # # Version: -# $Id: SConstruct,v 1.23 2005/08/18 02:23:47 cozman Exp $ +# $Id: SConstruct,v 1.24 2005/11/13 07:59:48 cozman Exp $ import os,os.path import glob @@ -70,10 +70,13 @@ if not env.GetOption('clean'): Exit(1) if not conf.CheckLibWithHeader('freetype', 'ft2build.h', 'C++'): print 'Freetype2 not found, exiting.' - Exit(1) + Exit(1) if not conf.CheckLibWithHeader('corona', 'corona.h', 'C++'): print 'Corona not found, exiting.' Exit(1) + if not conf.CheckCXXHeader('boost/utility.hpp'): + print 'Boost not found, exiting.' + Exit(1) if conf.CheckLibWithHeader(OAL_LIB, 'AL/al.h', 'C++'): conf.env.Append(CPPFLAGS='-DPHOTON_USE_OPENAL') else: @@ -93,8 +96,10 @@ env.Default(LIBRARY) # Documentation ndoc = env.Command('docs/index.html', './include', - """NaturalDocs -nag -i $SOURCES -o HTML ./docs -p ./ndoc""") + """NaturalDocs -nag -i $SOURCES -i ndoc/pages -o HTML ./docs -p ./ndoc""") env.Alias("docs",ndoc) +env.AlwaysBuild(ndoc) + # Tests: tests = [] diff --git a/include/Application.hpp b/include/Application.hpp index 129e29d..fb0b692 100644 --- a/include/Application.hpp +++ b/include/Application.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.hpp,v 1.22 2005/08/17 06:35:56 cozman Exp $ +// $Id: Application.hpp,v 1.23 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_APPLICATION_HPP #define PHOTON_APPLICATION_HPP @@ -28,8 +28,9 @@ namespace photon { // Class: Application -// Photon main class, contains functions that control creation of the display, -// setting the OpenGL view, input handling, timing, and management. +// Application main class, contains functions that control creation of the +// display, setting the OpenGL view, input handling, timing, and +// management. // // Application is a and therefore should be accessed through // Application::getInstance(). (Application Singleton is created/destroyed @@ -51,17 +52,18 @@ public: public: // Function: run // Runs application until a quit is requested either via the operating - // system (ex. Alt-F4) or through a call to . + // system (ex Alt-F4) or through a call to . // - // Should not be called before a has been set and a display has - // been created via . + // Throws: + // if called before a has been set + // and a display has been created via . void run(); - // called by run while !quit() + // called internally by run while !quit() void update(); // Function: quit - // Sets Quit flag, terminating application. + // Sets quit flag, terminating application. void quit(); // Function: getUpdateTaskManager @@ -69,7 +71,7 @@ public: // this TaskManager are executed after the current . // // Returns: - // Reference to "Update TaskManager" + // Reference to "Update " util::TaskManager& getUpdateTaskManager(); // Function: getRenderTaskManager @@ -77,7 +79,7 @@ public: // this TaskManager are executed after the current . // // Returns: - // Reference to "Render TaskManager" + // Reference to "Render " util::TaskManager& getRenderTaskManager(); // Function: isActive @@ -91,7 +93,8 @@ public: // Group: Window public: // Function: createDisplay - // This function attempts to create a display with the given parameters. + // This function attempts to create a display with the given parameters. + // Takes arguments for R,G,B,A values separately, generally not needed. // // Parameters: // width - desired width of display @@ -103,7 +106,7 @@ public: // depthBits - desired bitdepth of depth buffer // stencilBits - desired bitdepth of stencil buffer // fullscreen - true: fullscreen, false: windowed - // [title - title of application, optional] + // [title - title of application, optional] void createDisplay(uint width, uint height, uint redBits, uint greenBits, uint blueBits, uint alphaBits, uint depthBits, uint stencilBits, @@ -111,6 +114,8 @@ public: // Function: createDisplay // This function attempts to create a display with the given parameters. + // Takes one consolidated bpp value, which is generally preferred over + // separate R,G,B,A values. // // Parameters: // width - desired width of display @@ -180,7 +185,7 @@ public: // Creates a viewport with a given 3D perspective inside of a rectangular // portion of the screen. // - // Note that (true) will be called as a side effect. + // Note that (true) will be called as a side effect. // // Parameters: // x - X coord for top left corner of new viewport. @@ -196,7 +201,7 @@ public: // Function: setPerspectiveView // Sets entire screen as current viewport with a given 3D perspective. // - // Note that (true) will be called as a side effect. + // Note that (true) will be called as a side effect. // // Parameters: // fovy - The y axis field of view angle, in degrees. @@ -329,7 +334,7 @@ public: // Function: setFixedUpdateStep // Sets a fixed timestep to be used in calls to the current - // update method. This allows stability in physics systems. + // update method. This greatly enhances stability in physics systems. // // Parameters: // enable - if true, will enable fixed timestepping (if false will disable) @@ -343,10 +348,10 @@ public: // Group: State Management public: // Function: setState - // Set the current Application , removing all other . + // Set the current Application , first popping all current states. // // Template Parameters: - // StateT - Class derived from to set as current. + // StateT - -derived class to make current state. template void setState(); @@ -354,7 +359,7 @@ public: // Push a new , does not remove old . // // Template Parameters: - // StateT - Class derived from to push. + // StateT - -derived class to push. template void pushState(); @@ -369,18 +374,24 @@ public: // Get the Application's , should only be called after // . // + // Note that this function only exists if photon is compiled with Audio + // support enabled. + // // Return: // Reference to the . - audio::AudioCore& getAudioCore(); - - // Function: initAudioCore - // Initialize the , should be done before attempting to access - // it via . - // - // Arguments: - // deviceName - Optional name for desired Audio device, will use default - // device if none specified. - void initAudioCore(const std::string& deviceName=""); + audio::AudioCore& getAudioCore(); + + // Function: initAudioCore + // Initialize the , should be done before attempting to access + // it via . + // + // Note that this function only exists if photon is compiled with Audio + // support enabled. + // + // Arguments: + // deviceName - Optional name for desired Audio device, will use default + // device if none specified. + void initAudioCore(const std::string& deviceName=""); #endif //PHOTON_USE_OPENAL // Callbacks diff --git a/include/Log.hpp b/include/Log.hpp index edb70dc..f9ed089 100644 --- a/include/Log.hpp +++ b/include/Log.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Log.hpp,v 1.8 2005/08/02 23:07:52 cozman Exp $ +// $Id: Log.hpp,v 1.9 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_LOG_HPP #define PHOTON_LOG_HPP @@ -28,11 +28,11 @@ class Log // Group: (Con/De)structors public: // Function: Log - // Log constructor, initializes log singleton. + // Log constructor, initializes a log with no sinks. Log(); // Function: ~Log - // Log destructor, destroys log singleton. + // Log destructor, destroys log, flushing output streams/closing sinks. ~Log(); // Group: Sink Maintenance diff --git a/include/LogSink.hpp b/include/LogSink.hpp index 60b4669..9030775 100644 --- a/include/LogSink.hpp +++ b/include/LogSink.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: LogSink.hpp,v 1.2 2005/02/16 06:58:05 cozman Exp $ +// $Id: LogSink.hpp,v 1.3 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_LOGSINK_HPP #define PHOTON_LOGSINK_HPP @@ -42,8 +42,8 @@ enum LogLevel }; // Class: LogSink -// Base class for all LogSinks to be used with , derived classes must -// define message(LogLevel level, std::string string). +// Virtual base class for all LogSinks to be used with , derived classes +// must define writeMessage(LogLevel level, std::string string). // A LogSink recieves any messages passed to the log it's registered with. // // Children: @@ -103,7 +103,9 @@ private: typedef shared_ptr LogSinkPtr; // Class: ConsoleSink -// to be used with for simple console output. +// to be used with for simple console output. Note that due +// to nature of buffered I/O it is important to flush the stream to see output +// in realtime with ConsoleSink // // See Also: // , diff --git a/include/ResourceManaged.hpp b/include/ResourceManaged.hpp index f959208..6dbd2ae 100644 --- a/include/ResourceManaged.hpp +++ b/include/ResourceManaged.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: ResourceManaged.hpp,v 1.8 2005/08/08 19:19:24 cozman Exp $ +// $Id: ResourceManaged.hpp,v 1.9 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_RESOURCEMANAGED_HPP #define PHOTON_RESOURCEMANAGED_HPP @@ -22,20 +22,24 @@ namespace photon // resources that can be controlled, such as textures and music, can be // derived. Resource managed classes rely on a . // +// Unless extending Photon, generally ResourceManaged does not need to be +// directly used. For this reason public documentation is not availble. See +// ResourceManaged.hpp for documentation. +// // Children: // , // -// +// template class ResourceManaged { -// Group: (Con/De)structors +// Nondoc-Group: (Con/De)structors public: - // Function: ResourceManaged + // Nondoc-Function: ResourceManaged // Default constructor. ResourceManaged(); - // Function: ResourceManaged + // Nondoc-Function: ResourceManaged // Initializing constructor, calls with a filename/zipname. // // Parameters: @@ -45,45 +49,45 @@ public: // ResourceManaged(const std::string& name); - // Function: ~ResourceManaged + // Nondoc-Function: ~ResourceManaged // Destructor, calls . virtual ~ResourceManaged(); ResourceManaged& operator=(const ResourceManaged &rhs); -// Group: General +// Nondoc-Group: General public: - // Function: open + // Nondoc-Function: open // Opens new resource via the associated . // // Parameters: // name - name of resource virtual void open(const std::string& name); - // Function: release + // Nondoc-Function: release // Removes a reference to the resource, releasing if needed. // Generally called by destructor, so should rarely be called. virtual void release(); -// Group: Accessors +// Nondoc-Group: Accessors public: - // Function: getName + // Nondoc-Function: getName // Get the name associated with the resource. // // Returns: // Name of resource, or empty string if no resource is loaded. std::string getName() const; -// Group: Resource Manager Access +// Nondoc-Group: Resource Manager Access public: static ResMgrT resMgr_; - // Function: cleanUp + // Nondoc-Function: cleanUp // Cleans up any unused resources of the type. // (Ex. Image::cleanUp() will unload all images.) static void cleanUp(); - // Function: addResource + // Nondoc-Function: addResource // Define a new named resource. // (Ex. Image::addResource("monkey","images/monkey.png") would // make it so that any attempts to load "monkey" would load the image @@ -95,7 +99,7 @@ public: static void addResource(const std::string& name, const typename ResMgrT::ResDescT& desc); - // Function: addResource + // Nondoc-Function: addResource // Define a new unaliased resource. (name == path). // (Ex. Image::addResource("images/monkey.png") is essentially the same as // Image::addResource("images/monkey.png","images/monkey.png") diff --git a/include/State.hpp b/include/State.hpp index 77f97ef..6f8695a 100644 --- a/include/State.hpp +++ b/include/State.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: State.hpp,v 1.4 2005/08/16 06:32:39 cozman Exp $ +// $Id: State.hpp,v 1.5 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_STATE_HPP #define PHOTON_STATE_HPP @@ -24,10 +24,10 @@ namespace photon // to manage the state that the game is in. // // Implement as many or as few of the members of State as needed (the only -// necessary member being ) and make the state as current via -// . Once a state is made current it's -// update and render methods will be called every frame until either a new -// state is made current or the application ends. +// necessary member being ) and make the state current via +// /. Once a state is made +// current it's update and render methods will be called every frame until +// either a new state is made current or the application ends. // // The active state is also notified of events as they occur, overloading any // of the on* functions will result in the overloaded version being called @@ -111,8 +111,8 @@ public: // Called when the mouse is moved with the amount the mouse was moved by // NOT with the new position. // - // If the new position is needed it can be obtained via and - // . + // If the new position is needed it can be obtained via + // and . // // Parameters: // delta - Change in mouse position. diff --git a/include/exceptions.hpp b/include/exceptions.hpp index 2cf963c..1ce3600 100644 --- a/include/exceptions.hpp +++ b/include/exceptions.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: exceptions.hpp,v 1.6 2005/07/19 01:31:37 cozman Exp $ +// $Id: exceptions.hpp,v 1.7 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_EXCEPTIONS_HPP #define PHOTON_EXCEPTIONS_HPP @@ -101,8 +101,8 @@ public: }; // Class: ArgumentException -// ArgumentException should be thrown when an argument is passed to a function -// that is invalid. +// ArgumentException should be thrown when an invalid argument is passed to a +// function. // // Parent: // @@ -130,7 +130,7 @@ public: }; // Class: RangeException -// RangeException should be thrown if something (such as an array bound) is out +// RangeException should be thrown if something (such as an array index) is out // of bounds. // // Parent: diff --git a/include/math/Circle.hpp b/include/math/Circle.hpp index 01d3363..8d63013 100644 --- a/include/math/Circle.hpp +++ b/include/math/Circle.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Circle.hpp,v 1.3 2005/07/18 05:58:03 cozman Exp $ +// $Id: Circle.hpp,v 1.4 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_MATH_CIRCLE_HPP #define PHOTON_MATH_CIRCLE_HPP @@ -23,7 +23,10 @@ class Rect; // Defines geometric entity known as a circle. // // A plane curve everywhere equidistant from a given fixed point, the center. -// +// () +// +// Exists mainly to provide a bounding circle for objects, simplifying +// collision detection. // // Operators: // - Circle == Circle @@ -116,17 +119,11 @@ public: // Group: Accessors public: // Function: getCenter - // Get center . - // - // Returns: - // Center point. + // Get center . Point2 getCenter() const; // Function: getRadius // Get radius of Circle. - // - // Returns: - // Radius of circle. scalar getRadius() const; friend std::ostream& operator<<(std::ostream &o, const Circle &circle); diff --git a/include/math/Rect.hpp b/include/math/Rect.hpp index 992803e..2cd6dfb 100644 --- a/include/math/Rect.hpp +++ b/include/math/Rect.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Rect.hpp,v 1.2 2005/03/03 09:25:19 cozman Exp $ +// $Id: Rect.hpp,v 1.3 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_MATH_RECT_HPP #define PHOTON_MATH_RECT_HPP @@ -22,8 +22,11 @@ class Circle; // Class: Rect // Defines geometric entity known as a rectangle. // -// A four-sided plane figure with four right angles. +// A four-sided plane figure with four right angles. () // +// Exists mainly to provide a bounding rectangle for objects, simplifying +// collision detection. +// // Operators: // - Rect == Rect // - ostream& << Rect @@ -33,7 +36,7 @@ class Rect public: // Function: Rect - // Initializes rectangle at (0,0) with size of 0. + // Initializes rectangle at (0,0) with width/height of 0. Rect(); // Function: Rect @@ -64,14 +67,14 @@ bool operator==(const Rect &rhs) const; public: // Function: moveTo - // move rectangle to new location. + // Move rectangle to new location. // // Parameters: // topleft - Point describing new top left corner. void moveTo(const Point2 &topleft); // Function: moveRel - // move rectangle relative to current position. + // Move rectangle relative to current position. // // Parameters: // xMove - Distance to move horizontally. @@ -79,7 +82,7 @@ public: void moveRel(scalar xMove, scalar yMove); // Function: resize - // set new size for rectangle. + // Set new size for rectangle. // // Parameters: // width - New width for rectangle. @@ -87,7 +90,7 @@ public: void resize(scalar width, scalar height); // Function: resizeRel - // set new size for rectangle, relative to current size. + // Set new size for rectangle, relative to current size. // // Parameters: // widthDelta - Change to be applied to width of rectangle. @@ -139,7 +142,7 @@ public: bool contains(const Rect &rect) const; // Function: calcIntersection - // calculates & returns the intersection of two rectangles. + // Calculates & returns the intersection of two rectangles. // // Parameters: // rect - Rectangle to find & calculate area of intersection with. @@ -155,87 +158,51 @@ public: public: // Function: getX - // Get x coord of rectangle. (top left corner) - // - // Returns: - // Returns x coord of top left corner of rectangle. + // Get x coord of top left corner of rectangle. scalar getX() const; // Function: getY - // Get y coord of rectangle. (top left corner) - // - // Returns: - // Returns y coord of top left corner of rectangle. + // Get y coord of top left corner of rectangle. scalar getY() const; // Function: getTop // Get y coord of top side of rectangle. - // - // Returns: - // Returns y coord of top side of rectangle. scalar getTop() const; // Function: getLeft // Get x coord of left side of rectangle. - // - // Returns: - // Returns x coord of left side rectangle. scalar getLeft() const; // Function: getBottom // Get y coord of bottom side of rectangle. - // - // Returns: - // Returns y coord of bottom side of rectangle. scalar getBottom() const; // Function: getRight // Get x coord of right side of rectangle. - // - // Returns: - // Returns x coord of right side rectangle. scalar getRight() const; // Function: getWidth // Get width of rectangle. - // - // Returns: - // Returns width of rectangle. scalar getWidth() const; // Function: getHeight // Get height of rectangle. - // - // Returns: - // Height of rectangle. scalar getHeight() const; // Function: getTopLeft // Get top left corner of rectangle. - // - // Returns: - // Top left corner of rectangle. Point2 getTopLeft() const; // Function: getTopRight // Get top right corner of rectangle. - // - // Returns: - // Top right corner of rectangle. Point2 getTopRight() const; // Function: getBottomLeft // Get bottom left corner of rectangle. - // - // Returns: - // Bottom left corner of rectangle. Point2 getBottomLeft() const; // Function: getBottomRight // Get bottom right corner of rectangle. - // - // Returns: - // Bottom right corner of rectangle. Point2 getBottomRight() const; friend std::ostream& operator<<(std::ostream &o, const Rect &rect); diff --git a/include/math/Vector2.hpp b/include/math/Vector2.hpp index 3b0a768..b4a1b5c 100644 --- a/include/math/Vector2.hpp +++ b/include/math/Vector2.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Vector2.hpp,v 1.5 2005/07/17 02:40:58 cozman Exp $ +// $Id: Vector2.hpp,v 1.6 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_MATH_VECTOR2_HPP #define PHOTON_MATH_VECTOR2_HPP @@ -21,7 +21,7 @@ namespace math // Class: Vector2 // Represents a two-dimensional vector. A quantity specified by a magnitude -// and a direction. Vector is oriented in classical 2D graphics format with +// and a direction. Vector is oriented in classic 2D graphics format with // origin at top corner of screen. // // Operators: @@ -83,7 +83,7 @@ public: void set(scalar nx, scalar ny); // Function: resolveDeg - // resolve vector, given a magnitude & angle in degrees. + // Resolve vector, given a magnitude & angle in degrees. // // Parameters: // magnitude - Magnitude of new vector. @@ -95,7 +95,7 @@ public: // Function: resolveRad - // resolve vector, given a magnitude & angle in radians. + // Resolve vector, given a magnitude & angle in radians. // // Parameters: // magnitude - Magnitude of new vector. @@ -137,7 +137,7 @@ public: public: // Function: getMagnitude - // Get length of vector. + // Determine length of vector. // // Returns: // Length of the vector. @@ -147,13 +147,13 @@ public: // Angle of vector in degrees, angle is calculated with respect to positive // X axis. // - // | |90� + // | |90 // | | // | | - // |180�-----------------------0� or 360� + // |180-----------------------0 or 360 // | | // | | - // | |270� + // | |270 // // Returns: // Angle of vector (in degrees). diff --git a/include/math/math.hpp b/include/math/math.hpp index 52f709e..bbcf61b 100644 --- a/include/math/math.hpp +++ b/include/math/math.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: math.hpp,v 1.6 2005/07/18 05:58:03 cozman Exp $ +// $Id: math.hpp,v 1.7 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_MATH_MATH_HPP #define PHOTON_MATH_MATH_HPP @@ -48,7 +48,7 @@ T clamp(T val, C low, C high); // Parameters: // val1 - First value to compare. // val2 - Second value to compare. -// epsilon - Epsilon value, defaults to 0.0001. +// epsilon - Epsilon value, defaults to 0.000001. // // Returns: // true if |val1-val2| < epsilon, meaning values are approximately equal diff --git a/include/types.hpp b/include/types.hpp index de6c25a..c397162 100644 --- a/include/types.hpp +++ b/include/types.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: types.hpp,v 1.8 2005/08/12 06:26:00 cozman Exp $ +// $Id: types.hpp,v 1.9 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_TYPES_HPP #define PHOTON_TYPES_HPP @@ -39,7 +39,7 @@ typedef double scalar; // Group: STL/Boost Types // Type: StrVec -// Typedef for vector of strings, which is used all throughout photon. +// Typedef for vector of strings, which is used throughout photon. typedef std::vector StrVec; // Type: shared_ptr @@ -49,7 +49,10 @@ using boost::shared_ptr; // Group: Enums // Enum: KeyCode -// Enumeration defining keys, used in . +// Enumeration for keys, includes printable characters and special keys. +// +// Keys are shown roughly in the order they appear on the keyboard to aid +// finding a specific key. // // Enums: // KEY_ESC - Escape key @@ -305,7 +308,7 @@ enum KeyCode }; // Enum: MouseButton -// Enumeration defining buttons, used in . +// Enumeration defining mouse buttons. // // MB_LEFT - Left mouse button. // MB_MIDDLE - Middle mouse button. diff --git a/include/util/ConfigFile.hpp b/include/util/ConfigFile.hpp index ba11a6c..c78f868 100644 --- a/include/util/ConfigFile.hpp +++ b/include/util/ConfigFile.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: ConfigFile.hpp,v 1.6 2005/07/19 01:31:37 cozman Exp $ +// $Id: ConfigFile.hpp,v 1.7 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_CONFIGFILE_HPP #define PHOTON_UTIL_CONFIGFILE_HPP @@ -69,7 +69,7 @@ public: public: // Function: open - // open a file, processing it as an INI-like config file. + // Open a file, processing it as an INI-like config file. // // Parameters: // filename - Name of ConfigFile to open. diff --git a/include/util/FileBuffer.hpp b/include/util/FileBuffer.hpp index 7bec2ff..1e48423 100644 --- a/include/util/FileBuffer.hpp +++ b/include/util/FileBuffer.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: FileBuffer.hpp,v 1.4 2005/06/10 07:06:06 cozman Exp $ +// $Id: FileBuffer.hpp,v 1.5 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_FILEBUFFER_HPP #define PHOTON_UTIL_FILEBUFFER_HPP @@ -23,8 +23,14 @@ namespace util { // Class: FileBuffer -// Class for reading data from a file, uses PhysFS -// and is capable of reading from archives on the search path. +// Class for reading data from a file, uses PhysFS +// () +// and is capable of reading from archives on the search path. +// +// All paths used are relative to the search path. +// By default only files within the directory the application is running or +// it's subdirectories are accessible. Additional directories may be added +// to the search path via . class FileBuffer { @@ -38,7 +44,8 @@ public: // Initializing constructor, calls . // // Parameters: - // filename - Name of file to load. + // filename - Name of file to load. (See notes on how FileBuffer handles + // paths at top of page) FileBuffer(const std::string& filename); // Function: ~FileBuffer @@ -51,18 +58,20 @@ public: // Loads a file into the FileBuffer. // // Parameters: - // filename - Name of file to load. + // filename - Name of file to load. (See notes on how FileBuffer handles + // paths at top of page) void open(const std::string& filename); // Function: close - // Frees memory occupied by loaded data. + // Closes the file, all future read attempts will fail until is + // called agian. void close(); // Group: Accessors public: // Function: getData - // Loads an amount of data, returns a pointer to the loaded data. + // Reads data from file into a -vector. // If the requested amount of data wasn't available, returns only // what could be loaded. If amount is 0 (default), returns entire buffer. // @@ -88,7 +97,7 @@ public: uint getSize() const; // Function: isEOF - // Checks if internal cursor is at end of file. + // Checks if internal cursor has reached end of file. // // Returns: // True iff eof, false otherwise. diff --git a/include/util/Singleton.hpp b/include/util/Singleton.hpp index ee17e84..4fc126e 100644 --- a/include/util/Singleton.hpp +++ b/include/util/Singleton.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Singleton.hpp,v 1.8 2005/07/18 06:18:51 cozman Exp $ +// $Id: Singleton.hpp,v 1.9 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_SINGLETON_HPP #define PHOTON_UTIL_SINGLETON_HPP @@ -44,19 +44,19 @@ template class Singleton : public boost::noncopyable { public: - // Function: initialize - // Initialize the instance of the singleton, can be done explicitly if - // order of construction matters. Will be done on first call to - // getInstance otherwise. - static void initialize(); - // Function: destroy - // Destroy the instance of the singleton, can be done explicitly if order - // of destruction matters. Will be done automatically if not done. + // Destroy the instance of the singleton, must be done for every singleton + // created. + // + // Throws: + // if called for uninitialized singleton static void destroy(); // Function: getInstance // Get a reference to the instance of the derived class. + // + // Throws: + // if called for uninitialized singleton static T& getInstance(); protected: @@ -70,22 +70,6 @@ private: // template implementation -template -Singleton::Singleton() -{ - if(instance_ != 0) - { - throw PreconditionException("Attempt to double-initialize singleton."); - } - - instance_ = static_cast(this); // cast self to type of T* -} - -template -Singleton::~Singleton() -{ -} - template void Singleton::destroy() { @@ -112,6 +96,22 @@ T& Singleton::getInstance() return *instance_; //return dereferenced instance } +template +Singleton::Singleton() +{ + if(instance_ != 0) + { + throw PreconditionException("Attempt to double-initialize singleton."); + } + + instance_ = static_cast(this); // cast self to type of T* +} + +template +Singleton::~Singleton() +{ +} + template T* Singleton::instance_(0); diff --git a/include/util/Task.hpp b/include/util/Task.hpp index 5c6ac3b..ae59892 100644 --- a/include/util/Task.hpp +++ b/include/util/Task.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Task.hpp,v 1.1 2005/08/17 06:35:56 cozman Exp $ +// $Id: Task.hpp,v 1.2 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_TASK_HPP #define PHOTON_UTIL_TASK_HPP @@ -21,15 +21,18 @@ namespace util // Title: Task +// Group: Task-Related +// Two helper types related to the class. + // Enum: PriorityLevel // Enumeration defining priority of a Task. // // Values: -// PRI_LOWEST - Lowest priority available. -// PRI_LOW - Lower-than-usual priority. -// PRI_NORMAL - Normal priority, suitable for most tasks. -// PRI_HIGH - Lower-than-usual priority. // PRI_HIGHEST - Highest priority available. +// PRI_HIGH - Lower-than-usual priority. +// PRI_NORMAL - Normal priority, suitable for most tasks. +// PRI_LOW - Lower-than-usual priority. +// PRI_LOWEST - Lowest priority available. enum PriorityLevel { PRI_HIGHEST, @@ -39,6 +42,12 @@ enum PriorityLevel PRI_LOWEST }; +// Type: TaskPtr +// Pointer to a task, used since Task is abstract and will always be accessed +// via a pointer. +class Task; +typedef shared_ptr TaskPtr; + // Class: Task // Abstract class for tasks, which are runnable classes for use with // . @@ -53,9 +62,9 @@ public: // // Parameters: // name - Name for task, must be unique! - // priority - Optional argument for desired priority for the Task, - // controls order in which tasks are run by the . - // Default Priority is PRI_NORMAL + // priority - Optional argument for desired priority for + // the Task, controls order in which tasks are run by the + // . Default Priority is PRI_NORMAL. Task(const std::string& name, PriorityLevel priority=PRI_NORMAL); // Function: ~Task @@ -86,8 +95,8 @@ public: // task is paused. // // Note: - // Children of onPause should call Task::onPause to let the task know it's - // been paused. + // Derived tasks with overloaded onPause methods should call Task::onPause + // to let the task know it's been paused. virtual void onPause(); // Function: onUnpause @@ -95,8 +104,8 @@ public: // task is unpaused. // // Note: - // Children of onUnpause should call Task::onUnpause to let the task know - // it's been paused. + // Derived tasks with overloaded onUnpaus methods should call + // Task::onUnpause to let the task know it's been paused. virtual void onUnpause(); // Function: kill @@ -142,11 +151,6 @@ private: bool paused_; // if false task won't be executed }; -// Type: TaskPtr -// Pointer to a task, used since Task is abstract and will always be accessed -// via a pointer. -typedef shared_ptr TaskPtr; - } } diff --git a/include/util/TaskManager.hpp b/include/util/TaskManager.hpp index d63f199..740d110 100644 --- a/include/util/TaskManager.hpp +++ b/include/util/TaskManager.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: TaskManager.hpp,v 1.1 2005/08/17 06:35:56 cozman Exp $ +// $Id: TaskManager.hpp,v 1.2 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_TASKMANAGER_HPP #define PHOTON_UTIL_TASKMANAGER_HPP @@ -25,8 +25,8 @@ namespace util // handles adding, deleting, pausing, and unpausing tasks. // // To use TaskManager: -// - (1) Add any tasks (should be derived from ) -// - (2) Call step() every frame when task should update. +// - Add any tasks (should be derived from ) +// - Call step() every frame when task should update. class TaskManager { @@ -49,8 +49,7 @@ public: // tasks have the same priority, they are run in the order they were added. // // Parameters: - // timeDelta - The time elapsed between frames, possibly fixed via - // . + // timeDelta - The time elapsed between frames. void step(scalar timeDelta); // Group: Task Management diff --git a/include/util/Timer.hpp b/include/util/Timer.hpp index bf67b96..92489be 100644 --- a/include/util/Timer.hpp +++ b/include/util/Timer.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Timer.hpp,v 1.4 2005/08/08 07:27:50 cozman Exp $ +// $Id: Timer.hpp,v 1.5 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_TIMER_HPP #define PHOTON_UTIL_TIMER_HPP @@ -18,7 +18,7 @@ namespace util // Class: Timer // Class capable of keeping track of time. -// Time is returned in double format, in seconds. +// Time is kept in double format, representing seconds. class Timer { @@ -30,7 +30,7 @@ public: // // Parameters: // appTimeLinked - Option only available on creation of timer. When true - // timer will pause when the is paused. + // timer will pause when the Application timer is paused. // [default: true] Timer(bool appTimeLinked=true); @@ -57,16 +57,10 @@ public: public: // Function: getTime // Get time in seconds. (ie. A value of .001 means 1 millisecond.) - // - // Returns: - // Time on timer, in seconds. double getTime() const; // Function: isPaused // Check paused/unpaused status of timer. - // - // Returns: - // True if timer is paused, false if timer is running. bool isPaused() const; private: diff --git a/include/util/VersionInfo.hpp b/include/util/VersionInfo.hpp index f173557..fbe5357 100644 --- a/include/util/VersionInfo.hpp +++ b/include/util/VersionInfo.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: VersionInfo.hpp,v 1.7 2005/07/18 06:18:51 cozman Exp $ +// $Id: VersionInfo.hpp,v 1.8 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_VERSIONINFO_HPP #define PHOTON_UTIL_VERSIONINFO_HPP @@ -20,7 +20,7 @@ namespace util // Class: VersionInfo // Class which stores version information, such as release numbers. -// Format is majorRelease.Minor.Release [ExtraInfo]. +// Format is Major.Minor.Patch [ExtraInfo]. // // Operators: // - VersionInfo < VersionInfo @@ -35,12 +35,12 @@ public: // Group: Variables // Variable: majorRelease - // major release version number, should be changed when major changes take + // Major release version number, should be changed when major changes take // place. unsigned int majorRelease; // Variable: minor - // minor release version number, should be changed when key features are + // Minor release version number, should be changed when key features are // added/removed/changed. unsigned int minorRelease; @@ -54,7 +54,7 @@ public: std::string extra; // Group: (Con/De)structors - +public: // Function: VersionInfo // Default constructor. VersionInfo(); @@ -63,7 +63,7 @@ public: // Initializing constructor. // // Parameters: - // maj - majorRelease version number. + // maj - Major version number. // min - Minor version number. // pat - Patch number. // ext - Extra info string. [default: ""] diff --git a/include/util/filesys/filesys.hpp b/include/util/filesys/filesys.hpp index 0bea672..d9c7ccb 100644 --- a/include/util/filesys/filesys.hpp +++ b/include/util/filesys/filesys.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: filesys.hpp,v 1.4 2005/07/20 07:30:13 cozman Exp $ +// $Id: filesys.hpp,v 1.5 2005/11/13 07:59:48 cozman Exp $ #ifndef PHOTON_UTIL_FILESYS_FILESYS_HPP #define PHOTON_UTIL_FILESYS_FILESYS_HPP @@ -18,6 +18,34 @@ #include // Title: filesys:: +// The util::filesys:: namespace is a group of functions all related to dealing +// with the filesystem. Photon uses PhysFS (http://physfs.icculus.org) to +// provide this functionality. +// +// The Search Path: +// The search path is an important concept in Photon, due to the nature of +// PhysFS when a file is referenced Photon attempts to resolve it by checking +// for it within the search path. By default the search path only includes +// the directory where the application resides. Nothing which is not within +// this directory or a directory within it can be accessed. +// +// It is possible to add other directories to the search path using +// . Keep in mind that the search path is a list of +// directories which will be searched in order for any requested files. +// In other words if you wish to store your game media in a format like: +// | game/ +// | bin/ +// | images/ +// | audio/ +// | user-audio/ +// | +// +// You will need to add images/ and audio/ to the search path since they +// do not reside within bin (where the game is stored). Also assuming +// users are allowed to place custom audio files within user-audio/ you must +// also add it to the path. If you wish for files within it to override +// existing audio files, it should preceed audio/ in the search path, otherwise +// it should come be placed in the search path after audio/. namespace photon { @@ -30,21 +58,24 @@ namespace filesys // Function: getCDDirs // Gets a listing of the CD directories on a system (not supported on all -// systems) +// systems) On Windows it would return something like D:/ or E:/, whereas on +// Linux it would return something like /media/cdrom0. // // Returns: // A vector of strings containing the path to the CD directories. std::vector getCDDirs(); // Function: getBaseDir -// Get the path to the directory that the application is running in. +// Get the path of the directory that the application is running in. // // Returns: // Path to directory that application is running from. std::string getBaseDir(); // Function: getUserDir -// Get the path to the directory that the OS specifies for the user's home. +// Get the path of the directory that the OS specifies for the user's home. +// On Windows would resemble C:/Documents and Settings/User, on Linux something +// like /home/user/ // // Returns: // Path to user's home directory. @@ -69,8 +100,7 @@ void addToSearchPath(const std::string& dir, bool append=true); // Removes a directory from the search path, if it exists on the path. // // Parameters: -// dir - Directory to remove from the search path, if it doesn't exist -// nothing happens. +// dir - Directory to remove from the search path. Ignored if nonexistant. // // See Also: // @@ -91,7 +121,8 @@ std::vector getSearchPath(); // Group: Manipulation ///////////////////////////////////////////////////////// // Function: setWriteDir -// Sets the writing directory, used by and . +// Sets the writing directory, used by and . Unlike search +// path only one writable directory can be set at once. // // Parameters: // dir - Directory to make writeable diff --git a/include/video/Color.hpp b/include/video/Color.hpp index ede1e46..8eee51b 100644 --- a/include/video/Color.hpp +++ b/include/video/Color.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Color.hpp,v 1.1 2005/03/02 08:40:11 cozman Exp $ +// $Id: Color.hpp,v 1.2 2005/11/13 07:59:49 cozman Exp $ #ifndef PHOTON_VIDEO_COLOR_HPP #define PHOTON_VIDEO_COLOR_HPP @@ -23,6 +23,8 @@ namespace video // Class for storing components of a color. // // Operators: +// - Color = Color +// - Color == Color // - ostream& << Color class Color { @@ -65,7 +67,7 @@ public: // Group: Utility public: - // Functions: setColor + // Function: setColor // Creates color, component by component. // // Parameters: @@ -75,7 +77,7 @@ public: // a - Value for alpha component. [default: 255] void setColor(ubyte r, ubyte g, ubyte b, ubyte a=255); - // Functions: makeGLColor + // Function: makeGLColor // Makes the Color the current openGL color. (glColor4ub) void makeGLColor() const; diff --git a/include/video/Font.hpp b/include/video/Font.hpp index f8f8795..837bfbb 100644 --- a/include/video/Font.hpp +++ b/include/video/Font.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Font.hpp,v 1.8 2005/10/15 04:56:37 cozman Exp $ +// $Id: Font.hpp,v 1.9 2005/11/13 07:59:49 cozman Exp $ #ifndef PHOTON_VIDEO_FONT_HPP #define PHOTON_VIDEO_FONT_HPP @@ -23,16 +23,19 @@ class StreamFlusher { }; std::ostream& operator<<(std::ostream& os, const StreamFlusher& rhs); // Class: Font -// Simple OO wrapper around a TrueType font that can be drawn to textures and -// rendered via OpenGL. +// Simple wrapper object around a TrueType font that can be drawn to textures +// and rendered via OpenGL. // // Since Font is a child of , all memory management is // taken care of. +// +// Font is a resource managed class, and therefore all resources should +// be registered using and then loaded by their assigned +// name via or the appropriate constructor. // // Operators: // - Font = Font // - bool : True if font is loaded, false if not. -// - ostream& << Font class Font : public ResourceManaged { // Group: (Con/De)structors @@ -127,7 +130,7 @@ public: // y - Y position to start drawing text at. // // Returns: - // std::ostream& to stream, anything written to the stream before + // std::ostream reference, anything written to the stream before // will be drawn starting at the specified position. std::ostream& beginDraw(scalar x, scalar y); @@ -162,9 +165,9 @@ public: public: // Function: addResource // Define a new named resource. - // (Ex. Image::addResource("monkey","images/monkey.png") would - // make it so that any attempts to load "monkey" would load the image - // images/monkey.png) + // (Ex. Font::addResource("sans","freesans.ttf") would + // make it so that any attempts to load "sans" would load the font + // freesans.ttf) // // Parameters: // name - Name to give to resource. @@ -174,10 +177,10 @@ public: // Function: addResource // Define a new unaliased resource. (name == path). - // (Ex. Image::addResource("images/monkey.png") is essentially the same as - // Image::addResource("images/monkey.png","images/monkey.png") + // (Ex. Font::addResource("freesans.ttf") is essentially the same as + // Font::addResource("freesans.ttf","freesans.ttf") // - // Parameters:. + // Parameters: // path - Path of resource data file. static void addResource(const std::string& path, uint size); diff --git a/include/video/Image.hpp b/include/video/Image.hpp index 57417bd..479ac32 100644 --- a/include/video/Image.hpp +++ b/include/video/Image.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Image.hpp,v 1.2 2005/07/18 07:19:48 cozman Exp $ +// $Id: Image.hpp,v 1.3 2005/11/13 07:59:49 cozman Exp $ #ifndef PHOTON_VIDEO_IMAGE_HPP #define PHOTON_VIDEO_IMAGE_HPP @@ -21,17 +21,15 @@ namespace video // Image is a class which is used to store a single image, for use in 2D games. // // Image is derived from , which is a resource managed class. -// is a simple OO wrapper around the concept of a texture in OpenGL. -// An Image simply adds the ability to draw to a quad, as well as some rotation -// per-vertex tinting, and several other bonuses. +// An Image simply adds the ability to draw to a quad, as well as some scaling, +// rotation, per-vertex tinting, and several other bonuses. // // Since Image is a child of , all memory management is taken // care of. // // Operators: -// - Texture = Texture -// - operator bool -// - ostream& << Texture +// - Image = Image +// - bool : True if texture is loaded, false if not. class Image : public Texture { @@ -67,7 +65,7 @@ public: // Opens an image file, currently supported image types are BMP, GIF, JPEG, // PCX, PNG, and TGA. (Images can be any dimensions) // - // Loading is done via Corona. + // Loading is done via Corona () // // Parameters: // name - Name of the Image to open. diff --git a/include/video/Pen.hpp b/include/video/Pen.hpp index 1707702..2fe92bd 100644 --- a/include/video/Pen.hpp +++ b/include/video/Pen.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Pen.hpp,v 1.4 2005/08/23 21:55:03 cozman Exp $ +// $Id: Pen.hpp,v 1.5 2005/11/13 07:59:49 cozman Exp $ #ifndef PHOTON_VIDEO_PEN_HPP #define PHOTON_VIDEO_PEN_HPP @@ -25,7 +25,8 @@ namespace video // Class which is used for drawing primitives. // // Each instance of pen has a color, and the various members simply draw -// primitives in that color. +// primitives in that color. Since it is possible to change the color +// associated with a pen, there is often no need for multiple instances of Pen. class Pen { diff --git a/include/video/Texture.hpp b/include/video/Texture.hpp index 823c7d3..aef1868 100644 --- a/include/video/Texture.hpp +++ b/include/video/Texture.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Texture.hpp,v 1.4 2005/07/04 03:06:48 cozman Exp $ +// $Id: Texture.hpp,v 1.5 2005/11/13 07:59:49 cozman Exp $ #ifndef PHOTON_VIDEO_TEXTURE_HPP #define PHOTON_VIDEO_TEXTURE_HPP @@ -19,10 +19,12 @@ namespace video { // Class: Texture -// Simple OO wrapper around the concept of a texture in openGL. +// Simple OO wrapper around the concept of a texture in OpenGL. // // Since Texture is a child of , all memory management is // taken care of. +// +// Texture loading is done via Corona () // // Children: // @@ -30,7 +32,6 @@ namespace video // Operators: // - Texture = Texture // - bool : True if texture is loaded, false if not. -// - ostream& << Texture class Texture : public ResourceManaged { @@ -65,7 +66,7 @@ public: // Opens an image file, currently supported image types are BMP, GIF, JPEG, // PCX, PNG, and TGA. // - // Loading is done via Corona. + // Loading is done via Corona () // // Parameters: // name - Name of the Texture to open. @@ -102,7 +103,7 @@ public: // Function: addResource // Define a new named resource. - // (Ex. Image::addResource("monkey","images/monkey.png") would + // (Ex. Texture::addResource("monkey","images/monkey.png") would // make it so that any attempts to load "monkey" would load the image // images/monkey.png) // @@ -113,10 +114,10 @@ public: // Function: addResource // Define a new unaliased resource. (name == path). - // (Ex. Image::addResource("images/monkey.png") is essentially the same as - // Image::addResource("images/monkey.png","images/monkey.png") + // (Ex. Texture::addResource("images/monkey.png") is essentially the same + // as Texture::addResource("images/monkey.png","images/monkey.png") // - // Parameters:. + // Parameters: // path - Path of resource data file. static void addResource(const std::string& path); diff --git a/ndoc/Menu.txt b/ndoc/Menu.txt index 167cce9..812b1ac 100644 --- a/ndoc/Menu.txt +++ b/ndoc/Menu.txt @@ -24,55 +24,61 @@ Footer: Documentation for photon. Co # time it is run. When working with groups, just deal with the braces and # forget about the indentation and comments. # +# You can use this file on other computers even if they use different +# directories. As long as the command line points to the same source files, +# Natural Docs will be able to correct the locations automatically. +# # -------------------------------------------------------------------------- +File: Photon Documentation (/home/james/src/photon/ndoc/pages/index.txt) + Group: photon:: { - File: Application (Application.hpp) - File: Basic Types (types.hpp) - File: Exception/Error Types (exceptions.hpp) - File: Log (Log.hpp) - File: Logging Utilities (LogSink.hpp) - File: PhotonMain (entrypoint.hpp) - File: ResourceManaged (ResourceManaged.hpp) - File: ResourceManager (ResourceManager.hpp) - File: State (State.hpp) - File: Task (Task.hpp) - File: TaskManager (Kernel.hpp) + File: Application (/home/james/src/photon/include/Application.hpp) + File: Basic Types (/home/james/src/photon/include/types.hpp) + File: Exception/Error Types (/home/james/src/photon/include/exceptions.hpp) + File: Log (/home/james/src/photon/include/Log.hpp) + File: Logging Utilities (/home/james/src/photon/include/LogSink.hpp) + File: PhotonMain (/home/james/src/photon/include/entrypoint.hpp) + File: ResourceManaged (/home/james/src/photon/include/ResourceManaged.hpp) + File: ResourceManager (/home/james/src/photon/include/ResourceManager.hpp) + File: State (/home/james/src/photon/include/State.hpp) Group: Audio:: { - File: AudioCore (audio/AudioCore.hpp) - File: Source (audio/Source.hpp) + File: AudioCore (/home/james/src/photon/include/audio/AudioCore.hpp) + File: Source (/home/james/src/photon/include/audio/Source.hpp) } # Group: Audio:: Group: Math:: { - File: Circle (math/Circle.hpp) - File: Math Utilities (math/math.hpp) - File: Rect (math/Rect.hpp) - File: Vector2 (math/Vector2.hpp) + File: Circle (/home/james/src/photon/include/math/Circle.hpp) + File: Math Utilities (/home/james/src/photon/include/math/math.hpp) + File: Rect (/home/james/src/photon/include/math/Rect.hpp) + File: Vector2 (/home/james/src/photon/include/math/Vector2.hpp) } # Group: Math:: Group: Util:: { - File: ConfigFile (util/ConfigFile.hpp) - File: FileBuffer (util/FileBuffer.hpp) - File: filesys:: (util/filesys/filesys.hpp) - File: RandGen (util/RandGen.hpp) - File: Singleton (util/Singleton.hpp) - File: Timer (util/Timer.hpp) - File: VersionInfo (util/VersionInfo.hpp) + File: ConfigFile (/home/james/src/photon/include/util/ConfigFile.hpp) + File: FileBuffer (/home/james/src/photon/include/util/FileBuffer.hpp) + File: filesys:: (/home/james/src/photon/include/util/filesys/filesys.hpp) + File: RandGen (/home/james/src/photon/include/util/RandGen.hpp) + File: Singleton (/home/james/src/photon/include/util/Singleton.hpp) + File: Task (/home/james/src/photon/include/util/Task.hpp) + File: TaskManager (/home/james/src/photon/include/util/TaskManager.hpp) + File: Timer (/home/james/src/photon/include/util/Timer.hpp) + File: VersionInfo (/home/james/src/photon/include/util/VersionInfo.hpp) } # Group: Util:: Group: Video:: { - File: Color (video/Color.hpp) - File: Font (video/Font.hpp) - File: Image (video/Image.hpp) - File: Pen (video/Pen.hpp) - File: Texture (video/Texture.hpp) + File: Color (/home/james/src/photon/include/video/Color.hpp) + File: Font (/home/james/src/photon/include/video/Font.hpp) + File: Image (/home/james/src/photon/include/video/Image.hpp) + File: Pen (/home/james/src/photon/include/video/Pen.hpp) + File: Texture (/home/james/src/photon/include/video/Texture.hpp) } # Group: Video:: } # Group: photon:: @@ -85,5 +91,11 @@ Group: Index { Function Index: Functions Type Index: Types Variable Index: Variables + File Index: Files } # Group: Index + + +##### Do not change or remove these lines. ##### +Data: 1(D3333RuEG3lpEG636H93IRutu\38\9oNfG) +Data: 1(h3333RuEG3lpEG636H93IRutu\3\fu93Ip`G6) diff --git a/ndoc/pages/index.txt b/ndoc/pages/index.txt new file mode 100644 index 0000000..93e0b29 --- /dev/null +++ b/ndoc/pages/index.txt @@ -0,0 +1,24 @@ +Document: Photon Documentation + +Introduction: +This is the photon developer documentation, generated via NaturalDocs (http://naturaldocs.org) from +comments embedded directly in the code. If you're writing something with public documentation I'd +highly recommend it, since as you can see it's output looks signifigantly better than some of those +other documentation generators ;). + +How To Use The Docs: +In the left pane the public namespaces are listed, click on a namespace name +to expand or collapse it. Clicking on a class/topic name will show the documentation +for that class or topic. + +Helping Out: +If you see anything that is incorrect, incomplete, or is just poorly described . +and could use clarification, please be sure to let me know (cozman@users.sf.net). +I want this documentation to be as helpful as possible to both new and +experienced users of photon, so feel free to contact me with quesions, criticisms, +or suggestions of any kind. + +If you're interested in helping out, but don't feel like you could contribute useful code +someone to help keep the documentation current would be appreciated. If interested +in helping out in any way, I'd love to hear from you. + diff --git a/photon.mm b/photon.mm index 04fb07d..6b166a4 100644 --- a/photon.mm +++ b/photon.mm @@ -1,195 +1,142 @@ - + - + - + - + - - - - - - + + + - - + + - - - - + + + + + + - - - - + + + - - - - + - - - - - + - + + + - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/config1.ini b/test/config1.ini index 909cde7..b9ce6bb 100644 --- a/test/config1.ini +++ b/test/config1.ini @@ -1,11 +1,11 @@ -[] +[] #config1.ini - -[sec2] + +[sec2] fancy = 0 fancy2 = "james" - -[sec] -int=3 -float=3 -string=three + +[sec] +int=3 +float=3 +string=three diff --git a/test/config2.ini b/test/config2.ini index e47b545..d2ae292 100644 --- a/test/config2.ini +++ b/test/config2.ini @@ -1,9 +1,9 @@ -[] +[] #config2.ini - -[sec] + +[sec] var = 0 hex = 0xff - -[sec2] + +[sec2] var = 2