First working example
This commit is contained in:
@@ -27,33 +27,33 @@ namespace Dawn {
|
||||
camera = Camera::create(this);
|
||||
camera->transform->lookAt(glm::vec3(3, 3, 3), glm::vec3(0, 0, 0));
|
||||
|
||||
// cube = SimpleSpinningCubePrefab::create(this);
|
||||
cube = SimpleSpinningCubePrefab::create(this);
|
||||
|
||||
item = this->createSceneItem();
|
||||
auto meshRenderer = item->addComponent<MeshRenderer>();
|
||||
auto quadMeshHost = item->addComponent<QuadMeshHost>();
|
||||
auto material = item->addComponent<SimpleTexturedMaterial>();
|
||||
// item = this->createSceneItem();
|
||||
// auto meshRenderer = item->addComponent<MeshRenderer>();
|
||||
// auto quadMeshHost = item->addComponent<QuadMeshHost>();
|
||||
// auto material = item->addComponent<SimpleTexturedMaterial>();
|
||||
|
||||
if(FT_New_Face(
|
||||
this->game->renderManager.getFontManager()->fontLibrary,
|
||||
"C:\\Windows\\Fonts\\Arial.ttf",
|
||||
0,
|
||||
&face
|
||||
)) {
|
||||
assertUnreachable();
|
||||
}
|
||||
if(FT_Set_Pixel_Sizes(face, 0, 16)) {
|
||||
assertUnreachable();
|
||||
}
|
||||
// if(FT_New_Face(
|
||||
// this->game->renderManager.getFontManager()->fontLibrary,
|
||||
// "C:\\Windows\\Fonts\\Arial.ttf",
|
||||
// 0,
|
||||
// &face
|
||||
// )) {
|
||||
// assertUnreachable();
|
||||
// }
|
||||
// if(FT_Set_Pixel_Sizes(face, 0, 16)) {
|
||||
// assertUnreachable();
|
||||
// }
|
||||
|
||||
_newTrueTypePlaceholder(face, texture, charStore);
|
||||
FT_ULong c = 'B';
|
||||
auto x = charStore[c];
|
||||
glm::vec2 wh = glm::vec2(texture.getWidth(), texture.getHeight());
|
||||
quadMeshHost->uv0 = glm::vec2(0.0f, x.textureY) / wh;
|
||||
quadMeshHost->uv1 = (glm::vec2)quadMeshHost->uv0 + (x.bitmapSize / wh);
|
||||
std::cout << "Done" << std::endl;
|
||||
material->texture = &texture;
|
||||
// _newTrueTypePlaceholder(face, texture, charStore);
|
||||
// FT_ULong c = 'B';
|
||||
// auto x = charStore[c];
|
||||
// glm::vec2 wh = glm::vec2(texture.getWidth(), texture.getHeight());
|
||||
// quadMeshHost->uv0 = glm::vec2(0.0f, x.textureY) / wh;
|
||||
// quadMeshHost->uv1 = (glm::vec2)quadMeshHost->uv0 + (x.bitmapSize / wh);
|
||||
// std::cout << "Done" << std::endl;
|
||||
// material->texture = &texture;
|
||||
}
|
||||
|
||||
std::vector<Asset*> getRequiredAssets() override {
|
||||
|
Reference in New Issue
Block a user