Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
   Copyright (c) 2015 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _GL_RESOURCES_H_
#define _GL_RESOURCES_H_

#include "config.h"

#include "Platform/Headers/PlatformDefines.h"
#ifndef GLBINDING_STATIC
#define GLBINDING_STATIC
#endif

#include <glbinding/gl45/gl.h>
using namespace gl45;
namespace glext = gl45ext;

#include <glbinding/Binding.h>

#include "Platform/Video/Headers/RenderAPIWrapper.h"

struct SDL_Window;
typedef void *SDL_GLContext;

namespace NS_GLIM {
    enum class GLIM_ENUM : int;
}; //namespace NS_GLIM

namespace Divide {
namespace GLUtil {

/// Wrapper for glGetIntegerv
GLint getIntegerv(GLenum param);

#ifdef ENABLE_GPU_VALIDATION
/// Check the current operation for errors
void
DebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity,
              GLsizei length, const GLchar* message, const void* userParam);
#endif

/// Invalid object value. Used to compare handles and determine if they were
/// properly created
extern GLuint _invalidObjectID;
/// Main rendering window
extern SDL_Window* _mainWindow;
extern SDL_GLContext _glRenderContext;
extern vectorImpl<SDL_GLContext> _glSecondaryContexts;


void submitRenderCommand(const GenericDrawCommand& drawCommand,
                         bool useIndirectBuffer,
                         GLenum internalFormat,
                         GLuint indexBuffer = 0);

/// Populate enumeration tables with appropriate API values
void fillEnumTables();

extern std::array<GLenum, to_const_uint(BlendProperty::COUNT)> glBlendTable;
extern std::array<GLenum, to_const_uint(BlendOperation::COUNT)> glBlendOpTable;
extern std::array<GLenum, to_const_uint(ComparisonFunction::COUNT)>
    glCompareFuncTable;
extern std::array<GLenum, to_const_uint(StencilOperation::COUNT)>
    glStencilOpTable;
extern std::array<GLenum, to_const_uint(CullMode::COUNT)> glCullModeTable;
extern std::array<GLenum, to_const_uint(FillMode::COUNT)> glFillModeTable;
extern std::array<GLenum, to_const_uint(TextureType::COUNT)> glTextureTypeTable;
extern std::array<GLenum, to_const_uint(GFXImageFormat::COUNT)>
    glImageFormatTable;
extern std::array<GLenum, to_const_uint(PrimitiveType::COUNT)>
    glPrimitiveTypeTable;
extern std::array<GLenum, to_const_uint(GFXDataFormat::COUNT)> glDataFormat;
extern std::array<GLenum, to_const_uint(TextureWrap::COUNT)> glWrapTable;
extern std::array<GLenum, to_const_uint(TextureFilter::COUNT)>
    glTextureFilterTable;
extern std::array<NS_GLIM::GLIM_ENUM, to_const_uint(PrimitiveType::COUNT)>
    glimPrimitiveType;
extern std::array<GLenum, to_const_uint(ShaderType::COUNT)> glShaderStageTable;
extern std::array<stringImpl, to_const_uint(ShaderType::COUNT)>
    glShaderStageNameTable;
};  // namespace GLUtil
};  // namespace Divide

#endif

#include "glResources.inl"

Commits for Divide-Framework/trunk/Source Code/Platform/Video/OpenGL/Headers/glResources.h

Diff revisions: vs.
Revision Author Commited Message
557 Diff Diff IonutCava picture IonutCava Tue 10 Nov, 2015 12:00:20 +0000

[IonutCava]
- Gather all rendering calls from glVertexArray and glGenericVertexData into a single function in glResources: submitRenderCommand.
— This allows both classes to interpret GenericDrawCommands in the same way
- Use unsigned ints for all hasehs instead of size_t to avoid negative number hashes (useful for debugging)

540 Diff Diff IonutCava picture IonutCava Wed 28 Oct, 2015 19:06:28 +0000

[IonutCava]
- Remove the “Platform” folder from the Platform project as the name is redundant. Move files one level up

516 Diff Diff IonutCava picture IonutCava Tue 29 Sep, 2015 18:21:34 +0000

[IonutCava]
- Fixed VBO partitioning system
- Replaced some DELEGATE_BIND calls with lambda expressions
- Some multithreaded rendering work (still not functional)

509 Diff Diff IonutCava picture IonutCava Tue 01 Sep, 2015 16:04:10 +0000

[IonutCava]
- Initial code for async draw command creation

480 Diff Diff IonutCava picture IonutCava Fri 07 Aug, 2015 15:51:09 +0000

[Ionut]
- Rework PhysicsAsset <-> PhysicsComponent transform synchronization
- Added better GPU Validation defines

478 Diff Diff IonutCava picture IonutCava Thu 06 Aug, 2015 15:51:03 +0000

[Ionut]
- Migrated to vc140
- Fixed some code analysis issues
- Added some missing Eclipse files

477 Diff Diff IonutCava picture IonutCava Tue 07 Jul, 2015 16:03:35 +0000

[Ionut]
- Moving to pure OpenGL 4.5 context (Part 2: everything else)

474 Diff Diff IonutCava picture IonutCava Thu 18 Jun, 2015 16:16:07 +0000

[Ionut]
- More work on impostor rendering
- Fixed a bug with GlobalMemoryStatusEx and added proper error handling
- Moved transform feedback varying location to shader code from source code (available as of OpenGL4.4)

473 Diff Diff IonutCava picture IonutCava Wed 17 Jun, 2015 15:59:21 +0000

[Ionut]
- Crash fix at shutdown fixed (not forwarding postLoad from Object3D to SceneNode)
- Cleaned up DSAWrapper
- Box impostor in rendering component kept in sync with the parent SGN bounding box (untested)

456 IonutCava picture IonutCava Mon 01 Jun, 2015 16:11:31 +0000

[Ionut]
- More linux port work (does not compile)