Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-03 14:47:12 +0000
committerStijn Buys <ingar@osirion.org>2008-05-03 14:47:12 +0000
commit5d1e18b796d41e035d0d3e828cc6db54ed21a4b6 (patch)
treed4fc3cd9dd34a5064c6b159309ca9d247081e0d8 /src/render/render.cc
parent3dedab035c98772fd9607480bddc8ffd9d7dc799 (diff)
camera handling, Cockpit view
Diffstat (limited to 'src/render/render.cc')
-rw-r--r--src/render/render.cc33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/render/render.cc b/src/render/render.cc
index 6755e08..589dce3 100644
--- a/src/render/render.cc
+++ b/src/render/render.cc
@@ -9,9 +9,11 @@
#include <sstream>
#include <iomanip>
-#include "render/render.h"
-#include "render/tga.h"
#include "render/gl.h"
+#include "render/textures.h"
+#include "render/tga.h"
+#include "render/render.h"
+
#include "core/core.h"
#include "filesystem/filesystem.h"
#include "sys/sys.h"
@@ -58,27 +60,7 @@ void init()
con_print << " vendor " << gl::vendor() << std::endl;
con_print << " version " << gl::version() << std::endl;
- con_print << "Loading textures..." << std::endl;
-
- if (!texture( "bitmaps/loader.tga", 0)) {
- con_error << "Essential file bitmaps/loader.tga missing" << std::endl;
- core::application()->shutdown();
- }
-
- if (!texture("bitmaps/conchars.tga", 1)) {
- con_error << "Essential file bitmaps/conchars.tga missing" << std::endl;
- core::application()->shutdown();
- }
-
- if (!texture("bitmaps/crosshair.tga", 2)) {
- con_error << "Essential file bitmaps/crosshair.tga missing" << std::endl;
- core::application()->shutdown();
- }
-
- if (!texture("bitmaps/fx/flare01.tga", 3)) {
- con_error << "Essential file bitmaps/fx/flare01.tga missing" << std::endl;
- core::application()->shutdown();
- }
+ Textures::init();
// size of the vertex array in megabytes
r_arraysize = core::Cvar::get("r_arraysize", 0.0f , core::Cvar::Archive);
@@ -103,7 +85,7 @@ void shutdown()
{
con_print << "Shutting down renderer..." << std::endl;
- glDeleteTextures(2, textures);
+ Textures::shutdown();
// clear entity models, this will force a reload
for (std::map<unsigned int, core::Entity *>::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) {
@@ -112,7 +94,10 @@ void shutdown()
entity->entity_model = 0;
}
+ // clear models
core::Model::clear();
+
+ // clear vertex array
delete vertexarray;
vertexarray = 0;
}