diff --git a/SConstruct b/SConstruct index 10c3f4d..51c0674 100644 --- a/SConstruct +++ b/SConstruct @@ -5,7 +5,7 @@ # James Turk (jpt2433@rit.edu) # # Version: -# $Id: SConstruct,v 1.3 2005/03/02 08:46:45 cozman Exp $ +# $Id: SConstruct,v 1.4 2005/03/04 13:06:49 cozman Exp $ import os,os.path import glob @@ -40,7 +40,7 @@ class Builder: def getFiles(self, path, pat): """Get all files which match a glob in a directory""" return glob.glob( os.path.join(path,pat) ) - + def checkLibrary(self, name, lib, header): """Check if a library/header pair exists, report and bail if not""" if not self.conf.CheckLibWithHeader(lib, header, 'C++'): @@ -89,6 +89,10 @@ class Builder: self.namedBuild('photon', os.path.join('lib',libName), 'Library', default=True, source = self.srcFiles, CPPPATH = self.incDirs) + self.namedBuild('test00', 'test00', 'Program', default=False, + source = 'test00.cpp', CPPPATH = self.incDirs, + LIBPATH='./lib', + LIBS=['photon','openal32','glfw','opengl32','glu32','physfs']) self.buildSuperHeader(libName) ndoc = self.env.Command('docs/index.html', './include', """NaturalDocs -nag -i $SOURCES -o HTML ./docs -p ./ndoc""", diff --git a/include/AppCore.hpp b/include/AppCore.hpp index 177194c..09c349a 100644 --- a/include/AppCore.hpp +++ b/include/AppCore.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: AppCore.hpp,v 1.3 2005/03/02 08:40:51 cozman Exp $ +// $Id: AppCore.hpp,v 1.4 2005/03/04 13:06:49 cozman Exp $ #ifndef PHOTON_APPCORE_HPP #define PHOTON_APPCORE_HPP @@ -50,7 +50,7 @@ public: void createDisplay(uint width, uint height, uint redBits, uint greenBits, uint blueBits, uint alphaBits, uint depthBits, uint stencilBits, - bool fullscreen, const std::string &title); + bool fullscreen, const std::string& title); // Function: createDisplay // This function attempts to create a display with the given parameters. @@ -65,7 +65,7 @@ public: // title - title of application void createDisplay(uint width, uint height, uint bpp, uint depthBits, uint stencilBits, bool fullscreen, - const std::string &title); + const std::string& title); // Group: Input public: diff --git a/include/entrypoint.hpp b/include/entrypoint.hpp index 5b273f5..b92a4b3 100644 --- a/include/entrypoint.hpp +++ b/include/entrypoint.hpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: entrypoint.hpp,v 1.2 2005/02/16 06:58:05 cozman Exp $ +// $Id: entrypoint.hpp,v 1.3 2005/03/04 13:06:49 cozman Exp $ #ifndef PHOTON_ENTRYPOINT_HPP @@ -37,17 +37,18 @@ int mainclass(int argc, char *argv[]) StrVec args; for(int i=0; i < argc; ++i) args.push_back(argv[i]); - App app(argv[0]); + App::setInitOptions(argv[0]); + App app; return app.main(args); } catch(photon::Exception &e) { - photon::log.error() << e; + photon::Log::getInstance().error() << e; return 0; } catch(photon::Error &e) { - photon::log.critical() << e; + photon::Log::getInstance().critical() << e; return 1; } } diff --git a/include/photon.hpp b/include/photon.hpp index defab4a..b3f7ca9 100644 --- a/include/photon.hpp +++ b/include/photon.hpp @@ -5,11 +5,13 @@ #include "Application.hpp" #include "entrypoint.hpp" #include "exceptions.hpp" +#include "Kernel.hpp" #include "Log.hpp" #include "LogSink.hpp" #include "photon.hpp" #include "ResourceManaged.hpp" #include "ResourceManager.hpp" +#include "Task.hpp" #include "types.hpp" #include "audio/AudioCore.hpp" #include "glfw/types_glfw.hpp" diff --git a/include/util/Singleton.hpp b/include/util/Singleton.hpp index 6d6ba5a..3e086c5 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.5 2005/03/03 09:25:20 cozman Exp $ +// $Id: Singleton.hpp,v 1.6 2005/03/04 13:06:49 cozman Exp $ #ifndef PHOTON_UTIL_SINGLETON_HPP #define PHOTON_UTIL_SINGLETON_HPP @@ -43,7 +43,7 @@ namespace util // // Using The Singleton: // (code) -// YourClass::initialize(); +// YourClass::initialize(); //optional // YourClass& yc(YourClass::getInstance()); // // // use yc @@ -56,7 +56,9 @@ class Singleton : public boost::noncopyable public: // Function: initialize - // Initialize the instance of the singleton, must be done explicitly. + // 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 @@ -110,8 +112,7 @@ T& Singleton::getInstance() { if(instance_.get() == 0) { - throw PreconditionException("Attempt to get instance of uninitialized " - "singleton."); + initialize(); //initialize if nonexistant } return *instance_; //return dereferenced version diff --git a/ndoc/Menu.txt b/ndoc/Menu.txt index ae3df36..915e790 100644 --- a/ndoc/Menu.txt +++ b/ndoc/Menu.txt @@ -34,10 +34,12 @@ Group: photon:: { File: Basic Types (types.hpp) File: Entrypoint (entrypoint.hpp) File: Exception/Error Types (exceptions.hpp) + File: Kernel (Kernel.hpp) File: Log (Log.hpp) File: Logging Utilities (LogSink.hpp) File: ResourceManaged (ResourceManaged.hpp) File: ResourceManager (ResourceManager.hpp) + File: Task (Task.hpp) Group: audio:: { @@ -70,6 +72,7 @@ Group: photon:: { File: VideoCore (video\VideoCore.hpp) } # Group: video:: + } # Group: photon:: Group: Index { diff --git a/src/AppCore.cpp b/src/AppCore.cpp index e2db4b3..9202015 100644 --- a/src/AppCore.cpp +++ b/src/AppCore.cpp @@ -5,10 +5,11 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: AppCore.cpp,v 1.3 2005/03/02 08:43:33 cozman Exp $ +// $Id: AppCore.cpp,v 1.4 2005/03/04 13:06:49 cozman Exp $ #include "AppCore.hpp" +#include #include "glfw.h" //This file depends on glfw #include "exceptions.hpp" @@ -34,6 +35,8 @@ void AppCore::createDisplay(uint width, uint height, dispHeight_ = height; glfwSetWindowTitle(title.c_str()); // title is set separately + + quitRequested_ = false; //now that a window is open, no quit requested } void AppCore::createDisplay(uint width, uint height, uint bpp, @@ -41,7 +44,7 @@ void AppCore::createDisplay(uint width, uint height, uint bpp, const std::string &title) { // call main version of createDisplay with individual values for rgba bits - switch(depthBits) + switch(bpp) { case 8: createDisplay(width, height, 3, 3, 2, 0, depthBits, stencilBits, @@ -61,7 +64,8 @@ void AppCore::createDisplay(uint width, uint height, uint bpp, break; default: throw ArgumentException("bpp argument of createDisplay must be " - "8,16,24, or 32."); + "8,16,24, or 32, passed " + + boost::lexical_cast(bpp) ); } }