A downloadable project

This week I’ve been learning about and working on displaying a png image in my game. To start, I made a new texture class called cTexture within the graphics library. I am using the stb_image Library, which is a single header file, to load a png into CPU memory. It takes a file path and returns a pointer to a buffer of RGBA pixels. Once I have my array of pixel data, my new texture class will take over to bind the data to GPU buffers using OpenGL and Direct3D. 

Some random things I’ve been learning about:

  • Modern GPUs have 32 texture slots. 
  • Texture parameters
  • Reading in the texture is flipped

My next step is to make a vertex shader to read texture coordinates and colors using sampler2D. It looks like I will have some transparency issues in the future and will need to make blending function for the texture. 

Later, I will make a 2D Animator Project to hold animations and animators. This project will be tightly integrated with graphics due to needing the texture data. I will need to start thinking about how this project can be packaged up for others to import. I will most likely need to move the texture class out of graphics. 

I wasn’t able to work on this as much as I would have liked due to Halloween events with the cohort. I normally don’t go, but I love Halloween, and these events are good for making connections. People will remember that you were there. 

Published 21 days ago
StatusReleased
CategoryOther
AuthorChai

Leave a comment

Log in with itch.io to leave a comment.