// loading our textures
stbi_set_flip_vertically_on_load(true);
tex[0] = crpgTextureNew("textures/wall.jpg");
- tex[1] = crpgTextureNew("textures/awesomeface.png");
+ tex[1] = crpgTextureNew("textures/target.png");
shader = crpgShaderNew("tri");
crpgShaderUse(shader);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, crpgTextureGetID(tex[1]));
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBindVertexArray(vao);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
if(chan == 3){
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
} else if (chan == 4) {
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
} else {
err_output("Error loading texture, images that are not formatted as\
RGB or RGBA are unsupported!");