mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
GL/Program: Add IsBound() method
This commit is contained in:
parent
8d7b93766d
commit
b53e32e84f
|
@ -5,11 +5,11 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
Log_SetChannel(GL);
|
Log_SetChannel(GL);
|
||||||
|
|
||||||
static u32 s_next_bad_shader_id = 1;
|
|
||||||
static GLuint s_last_program_id = 0;
|
|
||||||
|
|
||||||
namespace GL {
|
namespace GL {
|
||||||
|
|
||||||
|
GLuint Program::s_last_program_id = 0;
|
||||||
|
static GLuint s_next_bad_shader_id = 1;
|
||||||
|
|
||||||
Program::Program() = default;
|
Program::Program() = default;
|
||||||
|
|
||||||
Program::~Program()
|
Program::~Program()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "glad.h"
|
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "glad.h"
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ public:
|
||||||
static void ResetLastProgram();
|
static void ResetLastProgram();
|
||||||
|
|
||||||
bool IsVaild() const { return m_program_id != 0; }
|
bool IsVaild() const { return m_program_id != 0; }
|
||||||
|
bool IsBound() const { return s_last_program_id == m_program_id; }
|
||||||
|
|
||||||
bool Compile(const std::string_view vertex_shader, const std::string_view fragment_shader);
|
bool Compile(const std::string_view vertex_shader, const std::string_view fragment_shader);
|
||||||
|
|
||||||
|
@ -78,6 +79,8 @@ public:
|
||||||
void BindUniformBlock(const char* name, u32 index);
|
void BindUniformBlock(const char* name, u32 index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static u32 s_last_program_id;
|
||||||
|
|
||||||
GLuint m_program_id = 0;
|
GLuint m_program_id = 0;
|
||||||
GLuint m_vertex_shader_id = 0;
|
GLuint m_vertex_shader_id = 0;
|
||||||
GLuint m_fragment_shader_id = 0;
|
GLuint m_fragment_shader_id = 0;
|
||||||
|
|
Loading…
Reference in a new issue