summaryrefslogtreecommitdiff
path: root/src/texture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/texture.cpp')
-rw-r--r--src/texture.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/texture.cpp b/src/texture.cpp
index 24cdc95..0bfac25 100644
--- a/src/texture.cpp
+++ b/src/texture.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 Frederico de Oliveira Linhares
+ * Copyright 2022-2024 Frederico de Oliveira Linhares
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,12 +18,12 @@
#include "core.hpp"
#include "font.hpp"
-#include "vk/texture.hpp"
+#include "blucat/texture.hpp"
void
cg_free_texture(mrb_state *mrb, void* obj)
{
- auto *ptr = static_cast<std::shared_ptr<VK::Texture>*>(obj);
+ auto *ptr = static_cast<std::shared_ptr<BluCat::Texture>*>(obj);
ptr->~shared_ptr();
mrb_free(mrb, ptr);
@@ -48,15 +48,15 @@ cg_cTexture_from_image(mrb_state *mrb, mrb_value self)
{
struct mrb_value texture = texture_alloc(mrb, self);
const char *file_path;
- std::shared_ptr<VK::Texture> *ptr;
+ std::shared_ptr<BluCat::Texture> *ptr;
mrb_get_args(mrb, "z", &file_path);
- ptr = (std::shared_ptr<VK::Texture>*)DATA_PTR(texture);
+ ptr = (std::shared_ptr<BluCat::Texture>*)DATA_PTR(texture);
if(ptr) mrb_free(mrb, ptr);
- ptr = (std::shared_ptr<VK::Texture>*)mrb_malloc(
- mrb, sizeof(std::shared_ptr<VK::Texture>));
- new(ptr)std::shared_ptr<VK::Texture>(
- std::make_shared<VK::Texture>(file_path));
+ ptr = (std::shared_ptr<BluCat::Texture>*)mrb_malloc(
+ mrb, sizeof(std::shared_ptr<BluCat::Texture>));
+ new(ptr)std::shared_ptr<BluCat::Texture>(
+ std::make_shared<BluCat::Texture>(file_path));
mrb_data_init(texture, ptr, &cg_texture_type);
return texture;
@@ -68,17 +68,17 @@ cg_cTexture_from_text(mrb_state *mrb, mrb_value self)
const char *text;
unsigned int width, height;
struct mrb_value texture = texture_alloc(mrb, self);
- VK::Font *font_ptr;
- std::shared_ptr<VK::Texture> *ptr;
+ BluCat::Font *font_ptr;
+ std::shared_ptr<BluCat::Texture> *ptr;
mrb_get_args(mrb, "dz", &font_ptr, &cg_font_type, &text);
- ptr = (std::shared_ptr<VK::Texture>*)DATA_PTR(texture);
+ ptr = (std::shared_ptr<BluCat::Texture>*)DATA_PTR(texture);
if(ptr) mrb_free(mrb, ptr);
- ptr = (std::shared_ptr<VK::Texture>*)mrb_malloc(
- mrb, sizeof(std::shared_ptr<VK::Texture>));
- new(ptr)std::shared_ptr<VK::Texture>(
- std::make_shared<VK::Texture>(font_ptr, text));
+ ptr = (std::shared_ptr<BluCat::Texture>*)mrb_malloc(
+ mrb, sizeof(std::shared_ptr<BluCat::Texture>));
+ new(ptr)std::shared_ptr<BluCat::Texture>(
+ std::make_shared<BluCat::Texture>(font_ptr, text));
mrb_data_init(texture, ptr, &cg_texture_type);
return texture;
@@ -87,14 +87,14 @@ cg_cTexture_from_text(mrb_state *mrb, mrb_value self)
static mrb_value
cg_cTexture_width(mrb_state *mrb, mrb_value self)
{
- auto ptr = (std::shared_ptr<VK::Texture>*)DATA_PTR(self);
+ auto ptr = (std::shared_ptr<BluCat::Texture>*)DATA_PTR(self);
return mrb_int_value(mrb, (*ptr)->width);
}
static mrb_value
cg_cTexture_height(mrb_state *mrb, mrb_value self)
{
- auto ptr = (std::shared_ptr<VK::Texture>*)DATA_PTR(self);
+ auto ptr = (std::shared_ptr<BluCat::Texture>*)DATA_PTR(self);
return mrb_int_value(mrb, (*ptr)->height);
}