source: trunk/src/video.h @ 2425

Last change on this file since 2425 was 2425, checked in by touky, 7 years ago

easymesh : "struct m_gpu" no longer exists and has been replaced by more simpler classes. VertexDecl&Buffer are now not created several times when using the same source datas.

  • Property svn:keywords set to Id
File size: 1.9 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    static void SetFov(float theta);
71    static void SetDepth(bool set);
72    static void SetClearColor(vec4 color);
73    static void SetClearDepth(float f);
74    static void SetDebugRenderMode(DebugRenderMode d);
75    static DebugRenderMode GetDebugRenderMode();
76    static void Clear(ClearMask m);
77    static void Capture(uint32_t *buffer);
78    static ivec2 GetSize();
79};
80
81} /* namespace lol */
82
83#endif // __LOL_VIDEO_H__
84
Note: See TracBrowser for help on using the repository browser.