Fix Implementation of J2D::DrawLine2D & J3D::DrawLine3D
This commit is contained in:
@@ -12,8 +12,7 @@
|
||||
// OpenGL Wrapper for rendering 2D graphics primitives in both a 2D and 3D context
|
||||
namespace JGL {
|
||||
|
||||
// All functions accept coordinates in pixel-screen space [0, 600]
|
||||
// and are internally transformed to OpenGL clip space [-1, +1]
|
||||
|
||||
struct RGBTuple {
|
||||
int r; int g; int b;
|
||||
};
|
||||
@@ -250,7 +249,8 @@ namespace JGL {
|
||||
bool InitTextEngine();
|
||||
|
||||
// TODO: implement correct coloring
|
||||
void RenderText(std::string text, float x, float y, float scale);
|
||||
using J3ML::u32;
|
||||
void RenderText(std::string text, float x, float y, float scale, u32 size = 16);
|
||||
|
||||
namespace J2D {
|
||||
void DrawPixel2D(const Color3& color, const Vector2 &coordinates);
|
||||
|
23
include/LearnOpenGL/Texture2D.h
Normal file
23
include/LearnOpenGL/Texture2D.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
namespace {
|
||||
// Texture2D is able to store and configure a texture in OpenGL
|
||||
// It also hosts utility functions for easy management.
|
||||
class Texture2D {
|
||||
public:
|
||||
unsigned int ID; // ID of the texture object
|
||||
unsigned int Width, Height;
|
||||
unsigned int InternalFormat;
|
||||
unsigned int ImageFormat;
|
||||
unsigned int WrapS;
|
||||
unsigned int WrapT;
|
||||
unsigned int Filter_Min;
|
||||
unsigned int Filter_Max;
|
||||
|
||||
Texture2D();
|
||||
|
||||
void Generate(unsigned int width, unsigned int height, unsigned char *data);
|
||||
|
||||
void Bind() const;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user