fixing stuff
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "Texture.h"
|
||||
#include <iostream>
|
||||
#include "loaders/stb_image.h"
|
||||
#include "glad/glad.h"
|
||||
#include "../lib/loaders/stb_image.h"
|
||||
#include "../lib/glad/glad.h"
|
||||
|
||||
auto Texture::init(const char* source_path) -> void {
|
||||
void Texture::init(const char* source_path) {
|
||||
glGenTextures(1, &tex_id);
|
||||
glBindTexture(GL_TEXTURE_2D, tex_id);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
@@ -12,7 +12,7 @@ auto Texture::init(const char* source_path) -> void {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
int nr_channels;
|
||||
auto data = stbi_load(source_path, &width, &height, &nr_channels, 0);
|
||||
stbi_uc *data = stbi_load(source_path, &width, &height, &nr_channels, 0);
|
||||
if (data) {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
Reference in New Issue
Block a user