src/Graphics/Graphics.cc
author Tero Marttila <terom@fixme.fi>
Thu, 22 Jan 2009 00:02:53 +0200
branchnew_graphics
changeset 414 cede5463b845
parent 412 721c60072091
permissions -rw-r--r--
port Input to new Graphics, still a bit hacky, but everything seems to work now
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) :
414
cede5463b845 port Input to new Graphics, still a bit hacky, but everything seems to work now
Tero Marttila <terom@fixme.fi>
parents: 412
diff changeset
    13
    engine(engine), display(display_config), 
412
721c60072091 new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    14
    // display must be set up before fonts, due to implicit CL_DisplayWindow
414
cede5463b845 port Input to new Graphics, still a bit hacky, but everything seems to work now
Tero Marttila <terom@fixme.fi>
parents: 412
diff changeset
    15
    fonts(resources), 
cede5463b845 port Input to new Graphics, still a bit hacky, but everything seems to work now
Tero Marttila <terom@fixme.fi>
parents: 412
diff changeset
    16
    // get the InputContext from display
cede5463b845 port Input to new Graphics, still a bit hacky, but everything seems to work now
Tero Marttila <terom@fixme.fi>
parents: 412
diff changeset
    17
    input(display.get_ic()->get_keyboard())
411
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    18
{
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    19
    assert(!graphics);
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
    // 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
    22
    graphics = this;
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    23
    
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    24
}
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    25
106aaf6eadfe there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    26
}