49 lines
No EOL
1.1 KiB
C++
49 lines
No EOL
1.1 KiB
C++
#pragma once
|
|
#include <3ds.h>
|
|
#include <stdio.h>
|
|
#include <dirent.h>
|
|
#include <vector>
|
|
#include <string>
|
|
#include <browse_entry.h>
|
|
#include <sstream>
|
|
#include <fstream>
|
|
#include <algorithm>
|
|
#include <citro3d.h>
|
|
#include "vshader_v_shbin.h"
|
|
#include <sstream>
|
|
|
|
#define CLEAR_COLOR 0x000000FF
|
|
|
|
#define DISPLAY_TRANSFER_FLAGS \
|
|
(GX_TRANSFER_FLIP_VERT(0) | GX_TRANSFER_OUT_TILED(0) | GX_TRANSFER_RAW_COPY(0) | \
|
|
GX_TRANSFER_IN_FORMAT(GX_TRANSFER_FMT_RGBA8) | GX_TRANSFER_OUT_FORMAT(GX_TRANSFER_FMT_RGB8) | \
|
|
GX_TRANSFER_SCALING(GX_TRANSFER_SCALE_NO))
|
|
|
|
#define TEXT_VTX_ARRAY_COUNT (4*1024)
|
|
|
|
typedef struct { float position[3]; float texcoord[2]; } textVertex_s;
|
|
|
|
class TextEngine {
|
|
public:
|
|
void Initialize(gfxScreen_t scn);
|
|
void setTextColor(u32 color);
|
|
void renderText(float x, float y, float scaleX, float scaleY, bool baseline, const char* text);
|
|
void Cleanup();
|
|
void Update();
|
|
|
|
C3D_RenderTarget* target;
|
|
|
|
private:
|
|
void addTextVertex(float vx, float vy, float tx, float ty);
|
|
|
|
DVLB_s* vshader_dvlb;
|
|
shaderProgram_s program;
|
|
|
|
textVertex_s* textVtxArray;
|
|
|
|
C3D_Mtx projection;
|
|
C3D_Tex* glyphSheets;
|
|
|
|
int uLoc_projection;
|
|
int textVtxArrayPos;
|
|
}; |