Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/ShaderProgram.h
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 10 Lines | |||||
#include "graphics/ShaderProgramPtr.h" | #include "graphics/ShaderProgramPtr.h" | ||||
#include "graphics/Texture.h" | #include "graphics/Texture.h" | ||||
#include "lib/ogl.h" | #include "lib/ogl.h" | ||||
#include "lib/file/vfs/vfs_path.h" | #include "lib/file/vfs/vfs_path.h" | ||||
#include "lib/res/handle.h" | #include "lib/res/handle.h" | ||||
#include <map> | #include <map> | ||||
#include <vector> | |||||
struct CColor; | struct CColor; | ||||
class CMatrix3D; | class CMatrix3D; | ||||
class CVector3D; | class CVector3D; | ||||
class CShaderDefines; | class CShaderDefines; | ||||
class CStrIntern; | class CStrIntern; | ||||
// Vertex data stream flags | // Vertex data stream flags | ||||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | public: | ||||
virtual void VertexAttribIPointer(attrib_id_t id, GLint size, GLenum type, GLsizei stride, const void* pointer); | virtual void VertexAttribIPointer(attrib_id_t id, GLint size, GLenum type, GLsizei stride, const void* pointer); | ||||
/** | /** | ||||
* Checks that all the required vertex attributes have been set. | * Checks that all the required vertex attributes have been set. | ||||
* Call this before calling glDrawArrays/glDrawElements etc to avoid potential crashes. | * Call this before calling glDrawArrays/glDrawElements etc to avoid potential crashes. | ||||
*/ | */ | ||||
void AssertPointersBound(); | void AssertPointersBound(); | ||||
virtual std::vector<VfsPath> GetFileDependencies() const = 0; | |||||
protected: | protected: | ||||
CShaderProgram(int streamflags); | CShaderProgram(int streamflags); | ||||
bool m_IsValid; | bool m_IsValid; | ||||
int m_StreamFlags; | int m_StreamFlags; | ||||
// Non-GLSL client state handling: | // Non-GLSL client state handling: | ||||
void BindClientStates(); | void BindClientStates(); | ||||
void UnbindClientStates(); | void UnbindClientStates(); | ||||
int m_ValidStreams; // which streams have been specified via VertexPointer etc since the last Bind | int m_ValidStreams; // which streams have been specified via VertexPointer etc since the last Bind | ||||
}; | }; | ||||
#endif // INCLUDED_SHADERPROGRAM | #endif // INCLUDED_SHADERPROGRAM |
Wildfire Games · Phabricator