diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 42f1129..0c5767a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,11 +1,13 @@ Changelog for Photon -$Id: CHANGELOG.txt,v 1.13 2005/11/13 07:59:48 cozman Exp $ +$Id: CHANGELOG.txt,v 1.14 2005/11/15 02:59:08 cozman Exp $ ! : Major Changes (potentially breaking existing code) + : New Features * : Minor Changes (bugfixes and behind-the-scenes changes) 0.1.0 + ! Changed createDisplay to use an enum to set fullscreen/windowed mode. + * Added first official tutorial. * 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 diff --git a/SConstruct b/SConstruct index cf765b8..9db0a9a 100644 --- a/SConstruct +++ b/SConstruct @@ -5,7 +5,7 @@ # James Turk (jpt2433@rit.edu) # # Version: -# $Id: SConstruct,v 1.24 2005/11/13 07:59:48 cozman Exp $ +# $Id: SConstruct,v 1.25 2005/11/15 02:59:08 cozman Exp $ import os,os.path import glob @@ -96,7 +96,7 @@ env.Default(LIBRARY) # Documentation ndoc = env.Command('docs/index.html', './include', - """NaturalDocs -nag -i $SOURCES -i ndoc/pages -o HTML ./docs -p ./ndoc""") + """NaturalDocs -nag -i $SOURCES -i ndoc/pages -i ndoc/tutorials -o HTML ./docs -p ./ndoc""") env.Alias("docs",ndoc) env.AlwaysBuild(ndoc) @@ -112,9 +112,3 @@ for test_src in test_srcs: 'physfs','corona','freetype'])) env.Alias('tests',tests) -# Visual C++ Projects -#if(os.name == 'nt'): -# msvc = env.MSVSProject(target = 'msvc/photon' + env['MSVSPROJECTSUFFIX'], -# srcs = getFilesMulti(SRC_DIRS, '*.cpp'), incs = INC_FILES, -# buildtarget = lib, variant = 'Release') -# env.Alias('msvc',msvc) diff --git a/include/Application.hpp b/include/Application.hpp index fb0b692..81a7b8b 100644 --- a/include/Application.hpp +++ b/include/Application.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.hpp,v 1.23 2005/11/13 07:59:48 cozman Exp $ +// $Id: Application.hpp,v 1.24 2005/11/15 02:59:08 cozman Exp $ #ifndef PHOTON_APPLICATION_HPP #define PHOTON_APPLICATION_HPP @@ -105,12 +105,13 @@ public: // alphaBits - desired bits per pixel for alpha value // depthBits - desired bitdepth of depth buffer // stencilBits - desired bitdepth of stencil buffer - // fullscreen - true: fullscreen, false: windowed + // fullscreen - , DISP_FULLSCREEN or DISP_WINDOWED // [title - title of application, optional] void createDisplay(uint width, uint height, uint redBits, uint greenBits, uint blueBits, uint alphaBits, uint depthBits, uint stencilBits, - bool fullscreen, const std::string& title="Photon App"); + DisplayMode mode, + const std::string& title="Photon App"); // Function: createDisplay // This function attempts to create a display with the given parameters. @@ -123,10 +124,10 @@ public: // bpp - desired bits per pixel (aka bitdepth) of display // depthBits - desired bitdepth of depth buffer // stencilBits - desired bitdepth of stencil buffer - // fullscreen - true: fullscreen, false: windowed + // fullscreen - , DISP_FULLSCREEN or DISP_WINDOWED // [title - title of application, optional] void createDisplay(uint width, uint height, uint bpp, - uint depthBits, uint stencilBits, bool fullscreen, + uint depthBits, uint stencilBits, DisplayMode mode, const std::string& title="Photon App"); // Function: setTitle diff --git a/include/entrypoint.hpp b/include/entrypoint.hpp index d2e4afb..8f853dc 100644 --- a/include/entrypoint.hpp +++ b/include/entrypoint.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: entrypoint.hpp,v 1.10 2005/08/16 06:32:39 cozman Exp $ +// $Id: entrypoint.hpp,v 1.11 2005/11/15 02:59:08 cozman Exp $ #ifndef PHOTON_ENTRYPOINT_HPP @@ -33,7 +33,7 @@ // Application& app(Application::getInstance); // // // create window -// app.createDisplay(800,600,32,0,0,false); +// app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // // // set current state // app.setState(); diff --git a/include/types.hpp b/include/types.hpp index c397162..dfb1849 100644 --- a/include/types.hpp +++ b/include/types.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: types.hpp,v 1.9 2005/11/13 07:59:48 cozman Exp $ +// $Id: types.hpp,v 1.10 2005/11/15 02:59:08 cozman Exp $ #ifndef PHOTON_TYPES_HPP #define PHOTON_TYPES_HPP @@ -330,6 +330,16 @@ enum ScrollDir SCROLL_UP, SCROLL_DOWN }; +// Enum: DisplayMode +// Enumeration defining types of displays. +// +// DISP_WINDOWED - Windowed Mode +// DISP_FULLSCREEN - Fullscreen Mode +enum DisplayMode +{ + DISP_WINDOWED, DISP_FULLSCREEN +}; + } #endif //PHOTON_TYPES_HPP diff --git a/ndoc/tutorials/tutorial01.txt b/ndoc/tutorials/tutorial01.txt index 28050ee..5ee3033 100644 --- a/ndoc/tutorials/tutorial01.txt +++ b/ndoc/tutorials/tutorial01.txt @@ -43,7 +43,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); app.setState(); app.run(); @@ -102,7 +102,7 @@ the following two pieces of code produce identical results: (code) // Sample 1 : Too Much Typing :( -Application::getInstance().createDisplay(800,600,32,0,0,true); +Application::getInstance().createDisplay(800,600,32,0,0,DISP_FULLSCREEN); Application::getInstance().setState(); Application::getInstance().run(); (end) @@ -111,7 +111,7 @@ Application::getInstance().run(); (code) // Sample 2 : Preferred Application& app(Application::getInstance()); -app.createDisplay(800,600,32,0,0,true); +app.createDisplay(800,600,32,0,0,DISP_FULLSCREEN); app.setState(); app.run(); (end) @@ -119,7 +119,7 @@ app.run(); is a fairly important class, it provides the means for managing the display, input, timer, task and state system. For simple 2D applications the only thing that needs to be done to configure the display is a single call -to (width, height, depth, 0, 0, fullscreen, title). +to (width, height, depth, 0, 0, displayMode, title). The input, timing, and task systems will be addressed in future tutorials, or check them out in docs. What about the state system? Well that brings us to our next topic... @@ -199,7 +199,7 @@ int PhotonMain(const StrVec& args) Application& app(Application::getInstance()); // create the display, in this case a 800x600 window with 32 bit depth - app.createDisplay(800,600,32,0,0,false); + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // set the application state to SomeState (a State-derived class) app.setState(); @@ -256,4 +256,4 @@ if you need specific help try asking for help on the Photon mailing lists (). Written for Photon 0.1.0 by James: - $Id: tutorial01.txt,v 1.2 2005/11/14 20:14:18 cozman Exp $ + $Id: tutorial01.txt,v 1.3 2005/11/15 02:59:08 cozman Exp $ diff --git a/photon.mm b/photon.mm index 6b166a4..a295512 100644 --- a/photon.mm +++ b/photon.mm @@ -8,9 +8,6 @@ - - - @@ -60,7 +57,7 @@ - + diff --git a/src/Application.cpp b/src/Application.cpp index 5c7a718..df7d561 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.cpp,v 1.30 2005/10/28 22:12:44 cozman Exp $ +// $Id: Application.cpp,v 1.31 2005/11/15 02:59:08 cozman Exp $ #include "Application.hpp" @@ -185,12 +185,12 @@ bool Application::isActive() void Application::createDisplay(uint width, uint height, uint redBits, uint greenBits, uint blueBits, uint alphaBits, uint depthBits, uint stencilBits, - bool fullscreen, const std::string &title) + DisplayMode mode, const std::string &title) { GLboolean status; - status = glfwOpenWindow(width, height, redBits, greenBits, - blueBits, alphaBits, depthBits, stencilBits, - fullscreen ? GLFW_FULLSCREEN : GLFW_WINDOW); + status = glfwOpenWindow(width, height, redBits, greenBits, blueBits, + alphaBits, depthBits, stencilBits, + mode == DISP_FULLSCREEN ? GLFW_FULLSCREEN : GLFW_WINDOW); if(status == GL_FALSE) { throw APIError("Failed to create display."); @@ -216,7 +216,7 @@ void Application::createDisplay(uint width, uint height, } void Application::createDisplay(uint width, uint height, uint bpp, - uint depthBits, uint stencilBits, bool fullscreen, + uint depthBits, uint stencilBits, DisplayMode mode, const std::string &title) { // call main version of createDisplay with individual values for rgba bits @@ -224,19 +224,19 @@ void Application::createDisplay(uint width, uint height, uint bpp, { case 8: createDisplay(width, height, 3, 3, 2, 0, depthBits, stencilBits, - fullscreen, title); + mode, title); break; case 16: createDisplay(width, height, 5, 6, 5, 0, depthBits, stencilBits, - fullscreen, title); + mode, title); break; case 24: createDisplay(width, height, 8, 8, 8, 0, depthBits, stencilBits, - fullscreen, title); + mode, title); break; case 32: createDisplay(width, height, 8, 8, 8, 8, depthBits, stencilBits, - fullscreen, title); + mode, title); break; default: throw ArgumentException("bpp argument of createDisplay must be " diff --git a/test/Audio_test.cpp b/test/Audio_test.cpp index b74a09b..de1c7d2 100644 --- a/test/Audio_test.cpp +++ b/test/Audio_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Audio_test.cpp,v 1.17 2005/08/18 05:59:56 cozman Exp $ +// $Id: Audio_test.cpp,v 1.18 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -186,7 +186,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window app.initAudioCore(); // initialize audio core // be sure to add FPSDisplayTask diff --git a/test/Font_test.cpp b/test/Font_test.cpp index 29a36e8..9f8ea29 100644 --- a/test/Font_test.cpp +++ b/test/Font_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Font_test.cpp,v 1.13 2005/08/17 06:35:56 cozman Exp $ +// $Id: Font_test.cpp,v 1.14 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -51,7 +51,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window // be sure to add FPSDisplayTask //TaskManager::getInstance().addTask(util::TaskPtr(new FPSDisplayTask())); diff --git a/test/Image_test.cpp b/test/Image_test.cpp index 1f6e270..8b8cff0 100644 --- a/test/Image_test.cpp +++ b/test/Image_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Image_test.cpp,v 1.13 2005/08/17 06:35:56 cozman Exp $ +// $Id: Image_test.cpp,v 1.14 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -62,7 +62,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window // be sure to add FPSDisplayTask app.getUpdateTaskManager().addTask(util::TaskPtr(new FPSDisplayTask())); diff --git a/test/Input_test.cpp b/test/Input_test.cpp index b116695..ecbd293 100644 --- a/test/Input_test.cpp +++ b/test/Input_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Input_test.cpp,v 1.12 2005/08/17 06:35:56 cozman Exp $ +// $Id: Input_test.cpp,v 1.13 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -121,7 +121,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window // be sure to add FPSDisplayTask app.getUpdateTaskManager().addTask(util::TaskPtr(new FPSDisplayTask())); diff --git a/test/Pen_test.cpp b/test/Pen_test.cpp index d3b1329..dc2334c 100644 --- a/test/Pen_test.cpp +++ b/test/Pen_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Pen_test.cpp,v 1.10 2005/08/17 06:35:56 cozman Exp $ +// $Id: Pen_test.cpp,v 1.11 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -75,7 +75,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window // be sure to add FPSDisplayTask app.getUpdateTaskManager().addTask(util::TaskPtr(new FPSDisplayTask())); diff --git a/test/State_test.cpp b/test/State_test.cpp index f7edbe9..125c74c 100644 --- a/test/State_test.cpp +++ b/test/State_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: State_test.cpp,v 1.4 2005/08/16 06:32:39 cozman Exp $ +// $Id: State_test.cpp,v 1.5 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -314,7 +314,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window app.setFixedUpdateStep(true, .01); // add archives to search path diff --git a/test/Texture_test.cpp b/test/Texture_test.cpp index d05f578..ce749c9 100644 --- a/test/Texture_test.cpp +++ b/test/Texture_test.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Texture_test.cpp,v 1.11 2005/08/17 06:35:56 cozman Exp $ +// $Id: Texture_test.cpp,v 1.12 2005/11/15 02:59:08 cozman Exp $ #include "photon.hpp" using namespace photon; @@ -75,7 +75,7 @@ int PhotonMain(const StrVec& args) { Application& app(Application::getInstance()); - app.createDisplay(800,600,32,0,0,false); // create window + app.createDisplay(800,600,32,0,0,DISP_WINDOWED); // create window // be sure to add FPSDisplayTask app.getUpdateTaskManager().addTask(util::TaskPtr(new FPSDisplayTask()));