mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
Decreased GL,GLFW presence out of Window module
This commit is contained in:
parent
086f04af39
commit
1d9fc44482
6 changed files with 28 additions and 16 deletions
|
|
@ -2,7 +2,7 @@
|
|||
#include "Texture.h"
|
||||
#include "Batch2D.h"
|
||||
|
||||
Font::Font(std::vector<Texture*> pages) : pages(pages) {
|
||||
Font::Font(std::vector<Texture*> pages, int lineHeight) : lineHeight_(lineHeight), pages(pages) {
|
||||
}
|
||||
|
||||
Font::~Font(){
|
||||
|
|
@ -26,6 +26,9 @@ Font::~Font(){
|
|||
// return 7;
|
||||
// }
|
||||
|
||||
int Font::lineHeight() const {
|
||||
return lineHeight_;
|
||||
}
|
||||
|
||||
bool Font::isPrintableChar(int c) {
|
||||
switch (c){
|
||||
|
|
@ -42,6 +45,10 @@ bool Font::isPrintableChar(int c) {
|
|||
|
||||
#define RES 16
|
||||
|
||||
int Font::calcWidth(std::wstring text) {
|
||||
return text.length() * 8;
|
||||
}
|
||||
|
||||
void Font::draw(Batch2D* batch, std::wstring text, int x, int y) {
|
||||
draw(batch, text, x, y, STYLE_NONE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,14 @@ class Batch2D;
|
|||
#define STYLE_OUTLINE 2
|
||||
|
||||
class Font {
|
||||
int lineHeight_;
|
||||
public:
|
||||
std::vector<Texture*> pages;
|
||||
Font(std::vector<Texture*> pages);
|
||||
Font(std::vector<Texture*> pages, int lineHeight);
|
||||
~Font();
|
||||
|
||||
int lineHeight() const;
|
||||
int calcWidth(std::wstring text);
|
||||
// int getGlyphWidth(char c);
|
||||
bool isPrintableChar(int c);
|
||||
void draw(Batch2D* batch, std::wstring text, int x, int y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue