-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTextureManager.h
66 lines (47 loc) · 1.97 KB
/
TextureManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (C) 2022 鏡原 尚 <[email protected]>
// This file is part of RaylibIMEInputSampleApp.
// RaylibIMEInputSampleApp is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// RaylibIMEInputSampleApp is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#ifndef TextureManager_h
#define TextureManager_h
#include "raylib.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <locale.h>
#include "config.h"
#include <ft2build.h>
#include FT_FREETYPE_H
typedef struct TextureManager
{
FT_Library m_ftLibrary;
FT_Face m_ftFace;
// raylib Image
Image m_Image;
// buffer data to initialize
unsigned char* m_InitData;
int m_FontSize;
int m_TextureWidth;
int m_TextureHeight;
// Currently, the cursor is always at the end of the text.
int m_CursorPosX;
int m_CursorPosY;
// Use to create texture
int m_currentX; // 現在何行目の描画をしているか
int m_currentRow; // 現在の横方向描画位置(ピクセル)
} TextureManager;
bool TextureManager_Initialize(TextureManager* manager, int width, int height, int fontSize);
Texture2D TextureManager_CreateTexture(TextureManager* manager, const int* text, int textLength);
#ifdef MANAGE_PREEDIT_CANDIDATE
Texture2D TextureManager_CreateTextureForCandidate(TextureManager* manager, int** candidates, int* lengths,
int pageSize, int selectedIndex);
#endif
#endif /* TextureManager_h */