init glfw for debug images + actually copy images over
This commit is contained in:
@@ -204,6 +204,8 @@ namespace platform {
|
||||
double elapsed() { return glfwGetTime(); }
|
||||
|
||||
void show_debug_image(std::string name, const char *data, size_t width, size_t height) {
|
||||
glfwInit();
|
||||
|
||||
static GLFWwindow *debug_window = nullptr;
|
||||
if (!debug_window) {
|
||||
debug_window = glfwCreateWindow(width, height, name.c_str(), nullptr, nullptr);
|
||||
@@ -233,6 +235,8 @@ void show_debug_image(std::string name, const char *data, size_t width, size_t h
|
||||
|
||||
|
||||
void show_color_debug_image(std::string name, const char *data, size_t logical_width, size_t logical_height, size_t width, size_t height) {
|
||||
glfwInit();
|
||||
|
||||
static GLFWwindow *debug_window = nullptr;
|
||||
if (!debug_window) {
|
||||
debug_window = glfwCreateWindow(logical_width, logical_height, name.c_str(), nullptr, nullptr);
|
||||
|
||||
@@ -203,7 +203,7 @@ void SpriteAtlas::update(const Sprite &sprite) {
|
||||
Rect<dimension> dst = atlas.getImage(name, sprite);
|
||||
const SpritePosition &src = sprite.getSpritePosition(name);
|
||||
if (src.width == dst.w * atlas.pixelRatio && src.height == dst.h * atlas.pixelRatio && src.pixelRatio == atlas.pixelRatio) {
|
||||
// atlas.copy(dst, src, sprite);
|
||||
atlas.copy(dst, src, sprite);
|
||||
return true;
|
||||
} else {
|
||||
fprintf(stderr, "sprite icon dimension mismatch\n");
|
||||
|
||||
Reference in New Issue
Block a user