Primitive Blending functionality
This commit is contained in:
parent
75aa577211
commit
0f9be33bd6
@ -1,8 +1,5 @@
|
|||||||
#include <YoggieEngine.h>
|
#include <YoggieEngine.h>
|
||||||
#include "CubeMap.h"
|
#include "CubeMap.h"
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
|
||||||
#include "../stb_image.h"
|
|
||||||
|
|
||||||
|
|
||||||
YoggieEngine::CubeMap::CubeMap()
|
YoggieEngine::CubeMap::CubeMap()
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
#include <YoggieEngine.h>
|
#include <YoggieEngine.h>
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include <GLFW/glfw3.h>
|
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
|
||||||
#include "../stb_image.h"
|
|
||||||
|
|
||||||
namespace YoggieEngine {
|
namespace YoggieEngine {
|
||||||
Texture::Texture(const std::string texturePath) {
|
Texture::Texture(const std::string texturePath , bool Transparency) {
|
||||||
int width, height, channels;
|
int width, height, channels;
|
||||||
unsigned char* data = stbi_load(texturePath.c_str(), &width, &height, &channels, 0);
|
unsigned char* data = stbi_load(texturePath.c_str(), &width, &height, &channels, 0);
|
||||||
|
|
||||||
@ -16,8 +13,15 @@ namespace YoggieEngine {
|
|||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
if (Transparency) {
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
|
}
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
namespace YoggieEngine {
|
namespace YoggieEngine {
|
||||||
class Texture {
|
class Texture {
|
||||||
public:
|
public:
|
||||||
Texture(const std::string texturePath);
|
Texture(const std::string texturePath, bool Transparency = false);
|
||||||
|
|
||||||
void Bind();
|
void Bind();
|
||||||
void Unbind();
|
void Unbind();
|
||||||
|
4
YoggieEngine/src/Graphics/stb_image.cpp
Normal file
4
YoggieEngine/src/Graphics/stb_image.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#include <YoggieEngine.h>
|
||||||
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
|
#include "stb_image.h"
|
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
// Important STL
|
// Important STL
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -18,7 +19,7 @@
|
|||||||
#include <glm/gtc/type_ptr.hpp>
|
#include <glm/gtc/type_ptr.hpp>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <entt/entt.hpp>
|
#include <entt/entt.hpp>
|
||||||
|
#include "Graphics/stb_image.h"
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
Loading…
Reference in New Issue
Block a user