diff options
author | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-31 22:08:05 +1100 |
---|---|---|
committer | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-03-31 22:08:05 +1100 |
commit | b771fc06a4339f466c0864ad896d5a96aee7e35d (patch) | |
tree | f667213fe01155e1ed56bc606a02e0f7c546fab5 /src/renderer/render.c | |
parent | 1b4c27d514423c9e27a93742b8c8e9eb9f588e27 (diff) |
adding image creation for textures
Diffstat (limited to 'src/renderer/render.c')
-rw-r--r-- | src/renderer/render.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/renderer/render.c b/src/renderer/render.c index 54b63b6..9dc47c2 100644 --- a/src/renderer/render.c +++ b/src/renderer/render.c @@ -247,29 +247,6 @@ texture texture_data_load(const char* path, bool invert_y) { .image_data = data }; } -void texture_data_upload(texture* tex) { - printf("Texture name %s\n", tex->name); - TRACE("Upload texture data"); - u32 texture_id; - glGenTextures(1, &texture_id); - glBindTexture(GL_TEXTURE_2D, texture_id); - tex->texture_id = texture_id; - - // set the texture wrapping parameters - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, - GL_REPEAT); // set texture wrapping to GL_REPEAT (default wrapping method) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - // set texture filtering parameters - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex->width, tex->height, 0, tex->channel_type, - GL_UNSIGNED_BYTE, tex->image_data); - glGenerateMipmap(GL_TEXTURE_2D); - DEBUG("Freeing texture image data after uploading to GPU"); - // stbi_image_free(tex->image_data); // data is on gpu now so we dont need it around -} - void dir_light_upload_uniforms(shader shader, directional_light* light) { uniform_vec3f(shader.program_id, "dirLight.direction", &light->direction); uniform_vec3f(shader.program_id, "dirLight.ambient", &light->ambient); |