src/Graphics/Graphics.cc
author Tero Marttila <terom@fixme.fi>
Wed, 21 Jan 2009 23:07:22 +0200
branchnew_graphics
changeset 412 721c60072091
parent 411 106aaf6eadfe
child 414 cede5463b845
permissions -rw-r--r--
new graphics code compiles... no, it doesn't work yet
411
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
#include "Graphics.hh"
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
#include <cassert>
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
namespace graphics
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     7
{
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     8
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     9
// initialize the global graphics object
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    10
Graphics *graphics = NULL;
411
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
Graphics::Graphics (Engine &engine, CL_ResourceManager &resources, const DisplayConfig &display_config) :
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    13
    // display must be set up before fonts, due to implicit CL_DisplayWindow
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    14
    engine(engine), display(display_config), fonts(resources)
411
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    15
{
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
    assert(!graphics);
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    18
    // set the global graphics object
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    19
    graphics = this;
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    20
    
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    21
}
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    22
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    23
}