source: trunk/src/video.h @ 2768

Last change on this file since 2768 was 2768, checked in by sam, 8 years ago

gpu: framebuffers now use the g_render object to restore viewport data.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://www.wtfpl.net/ for more details.
9//
10
11//
12// The Video interface
13// -------------------
14// Helper GL functions to set up the scene.
15//
16
17#if !defined __LOL_VIDEO_H__
18#define __LOL_VIDEO_H__
19
20#include <stdint.h>
21
22namespace lol
23{
24
25struct ClearMask
26{
27    enum Value
28    {
29        /* Note: D3D9 doesn't appear to support the accumulation buffer,
30         * and it is a deprecated OpenGL feature. No reason to support it. */
31        Color   = 1 << 0,
32        Depth   = 1 << 1,
33        Stencil = 1 << 2,
34
35        All     = 0xffffffff
36    }
37    m_value;
38
39    inline ClearMask(Value v) : m_value(v) {}
40    inline ClearMask(uint64_t i) : m_value((Value)i) {}
41    inline operator Value() { return m_value; }
42};
43
44struct DebugRenderMode
45{
46    enum Value
47    {
48        //Add your new rendermode at your convenience
49        Default,
50        Wireframe,
51        Lighting,
52        Normal,
53        UV,
54
55        Max
56    }
57    m_value;
58
59    inline DebugRenderMode() : m_value(Default) {}
60    inline DebugRenderMode(Value v) : m_value(v) {}
61    inline DebugRenderMode(int v) : m_value((Value)v) {}
62    inline operator Value() { return m_value; }
63};
64
65class Video
66{
67public:
68    static void Setup(ivec2 size);
69    static void Destroy();
70
71    static void SetDebugRenderMode(DebugRenderMode d);
72    static DebugRenderMode GetDebugRenderMode();
73    static void Clear(ClearMask m);
74    static void Capture(uint32_t *buffer);
75    static ivec2 GetSize();
76};
77
78} /* namespace lol */
79
80#endif // __LOL_VIDEO_H__
81
Note: See TracBrowser for help on using the repository browser.