source: trunk/src/video.h @ 2591

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

video : Added SetAlphaBlend() SetFaceCulling() SetCustomSize()
FrameBuffer : Added GetSize() & tweaked Bind()/Unbind() with size update for correct rendering.

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