]> icculus.org git repositories - dana/openbox.git/blob - otk/rendercontrol.cc
starting to make render's interface
[dana/openbox.git] / otk / rendercontrol.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #ifdef    HAVE_CONFIG_H
4 #  include "../config.h"
5 #endif // HAVE_CONFIG_H
6
7 #include "rendercontrol.hh"
8 #include "truerendercontrol.hh"
9 #include "rendertexture.hh"
10 #include "display.hh"
11 #include "screeninfo.hh"
12
13 extern "C" {
14 #ifdef    HAVE_STDLIB_H
15 #  include <stdlib.h>
16 #endif // HAVE_STDLIB_H
17
18 #include "gettext.h"
19 #define _(str) gettext(str)
20 }
21
22 namespace otk {
23
24 RenderControl *RenderControl::getRenderControl(int screen)
25 {
26   const ScreenInfo *info = display->screenInfo(screen);
27
28   // get the visual on the screen and return the correct type of RenderControl
29   int vclass = info->visual()->c_class;
30   switch (vclass) {
31   case TrueColor:
32     return new TrueRenderControl(info);
33   case PseudoColor:
34   case StaticColor:
35 //    return new PseudoRenderControl(info);
36   case GrayScale:
37   case StaticGray:
38 //    return new GrayRenderControl(info);
39   default:
40     printf(_("RenderControl: Unsupported visual %d specified. Aborting.\n"),
41            vclass);
42     ::exit(1);
43   }
44 }
45
46 RenderControl::RenderControl(const ScreenInfo *screen)
47   : _screen(screen)
48 {
49   printf("Initializing RenderControl\n");
50
51   
52 }
53
54 RenderControl::~RenderControl()
55 {
56   printf("Destroying RenderControl\n");
57
58
59 }
60
61 }