From 3f9d3190ffd5577482d42bab97b3160d15f46743 Mon Sep 17 00:00:00 2001 From: James Turk Date: Mon, 8 Aug 2005 19:19:21 +0000 Subject: [PATCH] 0.0.1 release preparation --- include/Application.hpp | 49 ++++++++++++------------ include/InputListener.hpp | 22 +++++------ include/ResourceManaged.hpp | 4 +- include/State.hpp | 58 ++++++++++++++++++++++++++++ include/audio/AudioCore.hpp | 4 +- include/entrypoint.hpp | 76 ++++++++++++++++++++----------------- include/photon.hpp | 2 +- include/types.hpp | 8 ++-- src/Application.cpp | 10 ++--- src/InputListener.cpp | 10 ++--- src/entrypoint.cpp | 48 +++++++++++++++++++++++ 11 files changed, 202 insertions(+), 89 deletions(-) create mode 100644 include/State.hpp create mode 100644 src/entrypoint.cpp diff --git a/include/Application.hpp b/include/Application.hpp index b4632df..96a00e1 100644 --- a/include/Application.hpp +++ b/include/Application.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.hpp,v 1.14 2005/08/08 07:27:50 cozman Exp $ +// $Id: Application.hpp,v 1.15 2005/08/08 19:19:24 cozman Exp $ #ifndef PHOTON_APPLICATION_HPP #define PHOTON_APPLICATION_HPP @@ -18,10 +18,10 @@ #include "types.hpp" #include "util/VersionInfo.hpp" +#include "State.hpp" #include "Task.hpp" #include "Kernel.hpp" #include "InputListener.hpp" -#include "video/VideoCore.hpp" #include "audio/AudioCore.hpp" #include "util/Singleton.hpp" @@ -29,24 +29,14 @@ namespace photon { - -class State -{ -public: - State() { }; - virtual ~State() { }; - -public: - virtual void update() { }; - virtual void render()=0; -}; - -typedef shared_ptr StatePtr; // Class: Application -// Abstract main class, all photon applications should derive from Application. +// Photon main class, contains functions that control creation of the display, +// setting the OpenGL view, input handling, timing, and management. // -// Derived classes are made entrypoint via . +// Class is a and therefore should be accessed through +// Application::getInstance(). (Application Singleton is created/destroyed +// automatically) class Application : public util::Singleton { @@ -151,7 +141,7 @@ public: void setOrthoView(scalar width, scalar height); // Function: setOrthoView - // Sets entire screen as current viewport with a given ortho perspective. + // Sets entire screen as current viewport with a 1:1 perspective. void setOrthoView(); // Group: Perspective @@ -173,8 +163,6 @@ public: // Function: setPerspectiveView // Sets entire screen as current viewport with a given 3D perspective. - // - // Same as call to setPerspective // // Parameters: // fovy - The y axis field of view angle, in degrees. @@ -317,12 +305,25 @@ public: template void setCurrentState(); -// Group: Core Access +// Group: AudioCore public: + // Function: getAudioCore + // Get the Application's , should only be called after + // . + // + // Return: + // Reference to the . audio::AudioCore& getAudioCore(); + + // Function: initAudioCore + // Initialize the , should be done before attempting to access + // it via . + // + // Arguments: + // deviceName - Name for desired Audio device. void initAudioCore(const std::string& deviceName); -// Group: API Initialization +// API Initialization private: util::VersionInfo initPhysFS(const std::string& arg0); util::VersionInfo initGLFW(); @@ -330,8 +331,8 @@ private: // Task Classes private: - // UpdateTask, does the updating work of AppCore, registered as a Task - // so that user need not call something akin to AppCore::update() every + // UpdateTask, does the updating work of Application, registered as a Task + // so that user need not call something akin to Application::update() every // frame class UpdateTask : public Task { diff --git a/include/InputListener.hpp b/include/InputListener.hpp index f3047a0..a580f0b 100644 --- a/include/InputListener.hpp +++ b/include/InputListener.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: InputListener.hpp,v 1.1 2005/07/19 05:45:23 cozman Exp $ +// $Id: InputListener.hpp,v 1.2 2005/08/08 19:19:24 cozman Exp $ #ifndef PHOTON_INPUTLISTENER_HPP #define PHOTON_INPUTLISTENER_HPP @@ -24,11 +24,11 @@ class InputListener public: // Function: InputListener - // Registers the InputListener to listen for input with . + // Registers the InputListener to listen for input with . InputListener(); // Function: ~InputListener - // Deregisters the listener with . so that it is no longer + // Deregisters the listener with . so that it is no longer // notified of events. virtual ~InputListener(); @@ -54,15 +54,15 @@ public: // Called when a key is pressed. // // Parameters: - // key - Key that has been pressed. - virtual void onKeyPress(int key); + // key - of key that has been pressed. + virtual void onKeyPress(KeyCode key); // Function: onKeyRelease // Called when a key is released. // // Parameters: - // key - Key that has been released. - virtual void onKeyRelease(int key); + // key - of key that has been released. + virtual void onKeyRelease(KeyCode key); // Group: Mouse Actions public: @@ -70,15 +70,15 @@ public: // Called when a mouse button is pressed. // // Parameters: - // button - Mouse button that was pressed. - virtual void onMouseButtonPress(int button); + // button - that was pressed. + virtual void onMouseButtonPress(MouseButton button); // Function: onMouseButtonRelease // Called when a mouse button is released. // // Parameters: - // button - Mouse button that was released. - virtual void onMouseButtonRelease(int button); + // button - that was released. + virtual void onMouseButtonRelease(MouseButton button); // Function: onMouseMove // Called when the mouse is moved. diff --git a/include/ResourceManaged.hpp b/include/ResourceManaged.hpp index 4ec99e7..f959208 100644 --- a/include/ResourceManaged.hpp +++ b/include/ResourceManaged.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: ResourceManaged.hpp,v 1.7 2005/07/04 03:06:48 cozman Exp $ +// $Id: ResourceManaged.hpp,v 1.8 2005/08/08 19:19:24 cozman Exp $ #ifndef PHOTON_RESOURCEMANAGED_HPP #define PHOTON_RESOURCEMANAGED_HPP @@ -25,7 +25,7 @@ namespace photon // Children: // , // -//