work on Texture, still not showing up.. but close (fixed segfault/bad viewport error)
This commit is contained in:
parent
7451b89ef4
commit
f34c0ac903
@ -5,7 +5,7 @@
|
|||||||
# James Turk (jpt2433@rit.edu)
|
# James Turk (jpt2433@rit.edu)
|
||||||
#
|
#
|
||||||
# Version:
|
# Version:
|
||||||
# $Id: SConstruct,v 1.11 2005/06/10 07:06:06 cozman Exp $
|
# $Id: SConstruct,v 1.12 2005/06/11 05:28:41 cozman Exp $
|
||||||
|
|
||||||
import os,os.path
|
import os,os.path
|
||||||
import glob
|
import glob
|
||||||
@ -91,6 +91,6 @@ for test_src in test_srcs:
|
|||||||
test_name = test_src.replace('_test.cpp','')
|
test_name = test_src.replace('_test.cpp','')
|
||||||
tests.append(env.Program(test_name, source=test_src, CPPPATH = INC_DIRS,
|
tests.append(env.Program(test_name, source=test_src, CPPPATH = INC_DIRS,
|
||||||
LIBPATH='./lib', CPPFLAGS = '-Wall -pedantic',
|
LIBPATH='./lib', CPPFLAGS = '-Wall -pedantic',
|
||||||
LIBS=['photon',OAL_LIB,'glfw',OGL_LIB,GLU_LIB,'physfs']))
|
LIBS=['photon',OAL_LIB,'glfw',OGL_LIB,GLU_LIB,'physfs','corona']))
|
||||||
env.Alias('test',tests)
|
env.Alias('test',tests)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: ResourceManager.hpp,v 1.3 2005/06/10 07:06:06 cozman Exp $
|
// $Id: ResourceManager.hpp,v 1.4 2005/06/11 05:28:41 cozman Exp $
|
||||||
|
|
||||||
#ifndef PHOTON_RESOURCEMANAGER_HPP
|
#ifndef PHOTON_RESOURCEMANAGER_HPP
|
||||||
#define PHOTON_RESOURCEMANAGER_HPP
|
#define PHOTON_RESOURCEMANAGER_HPP
|
||||||
@ -53,11 +53,12 @@ public:
|
|||||||
void delRef(uint id);
|
void delRef(uint id);
|
||||||
void cleanUp();
|
void cleanUp();
|
||||||
|
|
||||||
|
uint newResource(const std::string& name, const std::string& path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void loadResource(resT &res, const std::string& path)=0;
|
virtual void loadResource(resT &res, const std::string& path)=0;
|
||||||
virtual void freeResource(resT &res)=0;
|
virtual void freeResource(resT &res)=0;
|
||||||
|
|
||||||
uint newResource(const std::string& name, const std::string& path);
|
|
||||||
void deleteResource(uint id);
|
void deleteResource(uint id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
<node ID="Freemind_Link_50716011" TEXT="Texture">
|
<node ID="Freemind_Link_50716011" TEXT="Texture">
|
||||||
<node ID="Freemind_Link_561271163" TEXT="Font"/>
|
<node ID="Freemind_Link_561271163" TEXT="Font"/>
|
||||||
<node ID="Freemind_Link_385334177" TEXT="Image"/>
|
<node ID="Freemind_Link_385334177" TEXT="Image"/>
|
||||||
|
<node ID="Freemind_Link_973985797" TEXT="TEST">
|
||||||
|
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
|
||||||
|
<icon BUILTIN="messagebox_warning"/>
|
||||||
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node ID="Freemind_Link_1851655735" TEXT="Music"/>
|
<node ID="Freemind_Link_1851655735" TEXT="Music"/>
|
||||||
<node ID="Freemind_Link_1045379727" TEXT="Sound"/>
|
<node ID="Freemind_Link_1045379727" TEXT="Sound"/>
|
||||||
@ -71,7 +75,7 @@
|
|||||||
<icon BUILTIN="help"/>
|
<icon BUILTIN="help"/>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
<node ID="Freemind_Link_351891371" POSITION="left" TEXT="General Mateinance">
|
<node FOLDED="true" ID="Freemind_Link_351891371" POSITION="left" TEXT="General Mateinance">
|
||||||
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
|
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
|
||||||
<node ID="Freemind_Link_1978849189" TEXT="Clean up CVS">
|
<node ID="Freemind_Link_1978849189" TEXT="Clean up CVS">
|
||||||
<font NAME="SansSerif" SIZE="12"/>
|
<font NAME="SansSerif" SIZE="12"/>
|
||||||
@ -80,7 +84,6 @@
|
|||||||
</node>
|
</node>
|
||||||
<node ID="Freemind_Link_682620075" POSITION="left" TEXT="Current Problems">
|
<node ID="Freemind_Link_682620075" POSITION="left" TEXT="Current Problems">
|
||||||
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
|
<font BOLD="true" NAME="SansSerif" SIZE="12"/>
|
||||||
<node ID="Freemind_Link_1953928405" TEXT="Tests do not seem to compile (since ResourceManagers)"/>
|
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
</map>
|
</map>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: AppCore.cpp,v 1.6 2005/04/21 19:30:19 cozman Exp $
|
// $Id: AppCore.cpp,v 1.7 2005/06/11 05:28:41 cozman Exp $
|
||||||
|
|
||||||
#include "AppCore.hpp"
|
#include "AppCore.hpp"
|
||||||
|
|
||||||
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "Kernel.hpp"
|
#include "Kernel.hpp"
|
||||||
#include "exceptions.hpp"
|
#include "exceptions.hpp"
|
||||||
|
#include "video/VideoCore.hpp"
|
||||||
|
|
||||||
namespace photon
|
namespace photon
|
||||||
{
|
{
|
||||||
@ -50,6 +51,7 @@ void AppCore::createDisplay(uint width, uint height,
|
|||||||
|
|
||||||
dispWidth_ = width;
|
dispWidth_ = width;
|
||||||
dispHeight_ = height;
|
dispHeight_ = height;
|
||||||
|
video::VideoCore::getInstance().setDisplaySize(width,height);
|
||||||
|
|
||||||
glfwSetWindowTitle(title.c_str()); // title is set separately
|
glfwSetWindowTitle(title.c_str()); // title is set separately
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: Application.cpp,v 1.8 2005/05/15 02:50:52 cozman Exp $
|
// $Id: Application.cpp,v 1.9 2005/06/11 05:28:41 cozman Exp $
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
|
|
||||||
@ -20,6 +20,8 @@
|
|||||||
#include "AppCore.hpp"
|
#include "AppCore.hpp"
|
||||||
#include "video/VideoCore.hpp"
|
#include "video/VideoCore.hpp"
|
||||||
#include "audio/AudioCore.hpp"
|
#include "audio/AudioCore.hpp"
|
||||||
|
#include "util/filesys/filesys.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace photon
|
namespace photon
|
||||||
{
|
{
|
||||||
@ -33,7 +35,7 @@ Application::Application() :
|
|||||||
new Kernel;
|
new Kernel;
|
||||||
new AppCore;
|
new AppCore;
|
||||||
new video::VideoCore;
|
new video::VideoCore;
|
||||||
new audio::AudioCore;
|
//new audio::AudioCore;
|
||||||
|
|
||||||
// StrVec args;
|
// StrVec args;
|
||||||
//
|
//
|
||||||
@ -52,7 +54,7 @@ Application::~Application()
|
|||||||
// destroy the singletons
|
// destroy the singletons
|
||||||
AppCore::destroy();
|
AppCore::destroy();
|
||||||
video::VideoCore::destroy();
|
video::VideoCore::destroy();
|
||||||
audio::AudioCore::destroy();
|
//audio::AudioCore::destroy();
|
||||||
Kernel::destroy();
|
Kernel::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +67,7 @@ util::VersionInfo Application::initPhysFS()
|
|||||||
{
|
{
|
||||||
PHYSFS_Version ver;
|
PHYSFS_Version ver;
|
||||||
PHYSFS_init(arg0_.c_str());
|
PHYSFS_init(arg0_.c_str());
|
||||||
PHYSFS_addToSearchPath(arg0_.c_str(),0);
|
PHYSFS_addToSearchPath(PHYSFS_getBaseDir(),0);
|
||||||
PHYSFS_getLinkedVersion(&ver);
|
PHYSFS_getLinkedVersion(&ver);
|
||||||
return util::VersionInfo(ver.major, ver.minor, ver.patch);
|
return util::VersionInfo(ver.major, ver.minor, ver.patch);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: FileBuffer.cpp,v 1.5 2005/06/10 07:06:06 cozman Exp $
|
// $Id: FileBuffer.cpp,v 1.6 2005/06/11 05:28:41 cozman Exp $
|
||||||
|
|
||||||
#include "util/FileBuffer.hpp"
|
#include "util/FileBuffer.hpp"
|
||||||
|
|
||||||
@ -21,9 +21,10 @@ FileBuffer::FileBuffer() :
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
FileBuffer::FileBuffer(const std::string& filename) :
|
FileBuffer::FileBuffer(const std::string& filename)
|
||||||
file_( PHYSFS_openRead(filename.c_str()) )
|
{
|
||||||
{}
|
open(filename);
|
||||||
|
}
|
||||||
|
|
||||||
FileBuffer::~FileBuffer()
|
FileBuffer::~FileBuffer()
|
||||||
{}
|
{}
|
||||||
@ -31,6 +32,10 @@ FileBuffer::~FileBuffer()
|
|||||||
void FileBuffer::open(const std::string& filename)
|
void FileBuffer::open(const std::string& filename)
|
||||||
{
|
{
|
||||||
file_ = PHYSFS_openRead(filename.c_str());
|
file_ = PHYSFS_openRead(filename.c_str());
|
||||||
|
if(file_ == 0)
|
||||||
|
{
|
||||||
|
throw ResourceException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileBuffer::close()
|
void FileBuffer::close()
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// James Turk (jpt2433@rit.edu)
|
// James Turk (jpt2433@rit.edu)
|
||||||
//
|
//
|
||||||
// Version:
|
// Version:
|
||||||
// $Id: VideoCore.cpp,v 1.3 2005/04/21 19:30:19 cozman Exp $
|
// $Id: VideoCore.cpp,v 1.4 2005/06/11 05:28:41 cozman Exp $
|
||||||
|
|
||||||
#include "video/VideoCore.hpp"
|
#include "video/VideoCore.hpp"
|
||||||
|
|
||||||
@ -126,6 +126,7 @@ void VideoCore::initOpenGL()
|
|||||||
|
|
||||||
//setup alpha blending of 2D textures with the scene
|
//setup alpha blending of 2D textures with the scene
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user