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>2009-01-11 16:51:21 +0000
committerStijn Buys <ingar@osirion.org>2009-01-11 16:51:21 +0000
commit01a803bec48b1377d2714bce819fb2544eeeb44b (patch)
tree915a70eb23ea4f15f0a1293b2bdf5e594a10578a /src/client/video.cc
parent20e8e4c0fb1262a25c2491679da4587d264208a2 (diff)
initial loader frame
Diffstat (limited to 'src/client/video.cc')
-rw-r--r--src/client/video.cc50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/client/video.cc b/src/client/video.cc
index 57efa96..892f1a6 100644
--- a/src/client/video.cc
+++ b/src/client/video.cc
@@ -50,6 +50,8 @@ int height_prev = 0;
const int width_default = 1024;
const int height_default = 768;
+bool is_loader_frame = false;
+
bool init()
{
con_print << "^BInitializing video..." << std::endl;
@@ -272,13 +274,58 @@ void set_cursor()
}
}
+void loader_message(const char *message)
+{
+ if (!is_loader_frame)
+ return;
+
+ frame_loading(message);
+}
+
+void frame_loading(const char *message)
+{
+ using namespace render;
+
+ is_loader_frame = true;
+
+ // Clear the color and depth buffers.
+ gl::clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ render::Camera::ortho();
+
+ gl::enable(GL_TEXTURE_2D);
+ gl::enable(GL_BLEND);
+
+ gl::color(1.0f, 1.0f, 1.0f, 1.0f);
+ render::Textures::load("bitmaps/banner");
+ gl::begin(gl::Quads);
+
+ gl::vertex(0, 0);
+ gl::vertex(0, render::State::height());
+ gl::vertex(render::State::width(), render::State::height());
+ gl::vertex(render::State::width(), 0);
+ gl::end();
+
+
+ if (message) {
+ Text::setfont("gui", 12, 18);
+ Text::setcolor('N'); //set normal color
+ Text::draw(Text::fontwidth(), Text::fontheight(), message);
+ }
+
+ gl::disable(GL_TEXTURE_2D);
+ gl::disable(GL_BLEND);
+ SDL_GL_SwapBuffers();
+}
+
void frame(float elapsed)
{
+ is_loader_frame = false;
+
// detect fullscreen/windowed mode switch
if (fullscreen != r_fullscreen->value())
restart();
- using namespace render;
+ using namespace render;
// Clear the color and depth buffers.
gl::clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -302,6 +349,7 @@ void frame(float elapsed)
}
gl::color(1.0f, 1.0f, 1.0f, 1.0f);
+
gl::disable(GL_TEXTURE_2D);
gl::enable(GL_BLEND);