linter: opengl_shader.cpp
This commit is contained in:
@@ -15,7 +15,7 @@ OpenGLShader::~OpenGLShader() {
|
||||
}
|
||||
|
||||
#ifndef __APPLE__
|
||||
bool OpenGLShader::initGLExtensions() {
|
||||
auto OpenGLShader::initGLExtensions() -> bool {
|
||||
glCreateShader = (PFNGLCREATESHADERPROC)SDL_GL_GetProcAddress("glCreateShader");
|
||||
glShaderSource = (PFNGLSHADERSOURCEPROC)SDL_GL_GetProcAddress("glShaderSource");
|
||||
glCompileShader = (PFNGLCOMPILESHADERPROC)SDL_GL_GetProcAddress("glCompileShader");
|
||||
@@ -62,7 +62,7 @@ void OpenGLShader::checkGLError(const char* operation) {
|
||||
}
|
||||
}
|
||||
|
||||
GLuint OpenGLShader::compileShader(const std::string& source, GLenum shader_type) {
|
||||
auto OpenGLShader::compileShader(const std::string& source, GLenum shader_type) -> GLuint {
|
||||
if (source.empty()) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"ERROR: El código fuente del shader está vacío");
|
||||
@@ -105,7 +105,7 @@ GLuint OpenGLShader::compileShader(const std::string& source, GLenum shader_type
|
||||
return shader_id;
|
||||
}
|
||||
|
||||
GLuint OpenGLShader::linkProgram(GLuint vertex_shader, GLuint fragment_shader) {
|
||||
auto OpenGLShader::linkProgram(GLuint vertex_shader, GLuint fragment_shader) -> GLuint {
|
||||
GLuint program = glCreateProgram();
|
||||
if (program == 0) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
@@ -211,7 +211,7 @@ void OpenGLShader::createQuadGeometry() {
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
GLuint OpenGLShader::getTextureID(SDL_Texture* texture) {
|
||||
auto OpenGLShader::getTextureID(SDL_Texture* texture) -> GLuint {
|
||||
if (!texture) return 1;
|
||||
|
||||
SDL_PropertiesID props = SDL_GetTextureProperties(texture);
|
||||
@@ -237,10 +237,10 @@ GLuint OpenGLShader::getTextureID(SDL_Texture* texture) {
|
||||
return texture_id;
|
||||
}
|
||||
|
||||
bool OpenGLShader::init(SDL_Window* window,
|
||||
auto OpenGLShader::init(SDL_Window* window,
|
||||
SDL_Texture* texture,
|
||||
const std::string& vertex_source,
|
||||
const std::string& fragment_source) {
|
||||
const std::string& fragment_source) -> bool {
|
||||
window_ = window;
|
||||
back_buffer_ = texture;
|
||||
renderer_ = SDL_GetRenderer(window);
|
||||
|
||||
Reference in New Issue
Block a user