mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-12 07:03:34 +00:00
removing xpm support bc frick xpm
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */
|
||||
/* Updated: 2023/04/05 13:42:39 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/06 15:27:21 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -63,27 +63,6 @@ namespace mlx::core
|
||||
return map;
|
||||
}
|
||||
|
||||
void* Application::newXpmTexture(char** data, int* w, int* h)
|
||||
{
|
||||
std::vector<uint8_t> pixels = parseXpmData(data, w, h);
|
||||
std::shared_ptr<Texture> texture = std::make_shared<Texture>();
|
||||
texture->create(pixels.data(), *w, *h, VK_FORMAT_R8G8B8A8_UNORM);
|
||||
TextureID id = _texture_lib.addTextureToLibrary(texture);
|
||||
_texture_ids.push_back(id);
|
||||
return &_texture_ids.back();
|
||||
}
|
||||
|
||||
void* Application::newXpmTexture(std::string filename, int* w, int* h)
|
||||
{
|
||||
/*
|
||||
std::shared_ptr<Texture> texture = std::make_shared<Texture>();
|
||||
texture->create(reinterpret_cast<uint8_t*>(xpm_image.data), *w, *h, VK_FORMAT_R8G8B8A8_UNORM);
|
||||
TextureID id = _texture_lib.addTextureToLibrary(texture);
|
||||
_texture_ids.push_back(id);
|
||||
return &_texture_ids.back();
|
||||
*/
|
||||
}
|
||||
|
||||
void Application::destroyTexture(void* ptr)
|
||||
{
|
||||
vkDeviceWaitIdle(Render_Core::get().getDevice().get());
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 21:49:46 by maldavid #+# #+# */
|
||||
/* Updated: 2023/04/04 20:53:21 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/06 15:27:32 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -49,10 +49,6 @@ namespace mlx::core
|
||||
inline void pixelPut(void* win_ptr, int x, int y, int color) const noexcept;
|
||||
|
||||
void* newTexture(int w, int h);
|
||||
#ifndef MLX_NO_XPM
|
||||
void* newXpmTexture(std::string filename, int* w, int* h);
|
||||
void* newXpmTexture(char** data, int* w, int* h);
|
||||
#endif
|
||||
void* newStbTexture(char* file, int* w, int* h); // stb textures are format managed by stb image (png, jpg, bpm, ...)
|
||||
char* mapTexture(void* img_ptr, int* bits_per_pixel, int* size_line, int* endian);
|
||||
inline void texturePut(void* win_ptr, void* img, int x, int y);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 17:35:20 by maldavid #+# #+# */
|
||||
/* Updated: 2023/04/04 21:02:29 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/06 15:27:54 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
#include <renderer/core/render_core.h>
|
||||
#include <filesystem>
|
||||
|
||||
#ifndef MLX_NO_XPM
|
||||
#include <X11/xpm.h>
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void* mlx_init()
|
||||
@@ -140,18 +136,6 @@ extern "C"
|
||||
return static_cast<mlx::core::Application*>(mlx)->newStbTexture(filename, width, height);
|
||||
}
|
||||
|
||||
#ifndef MLX_NO_XPM
|
||||
void* mlx_xpm_file_to_image(void* mlx, char* filename, int* width, int* height)
|
||||
{
|
||||
return static_cast<mlx::core::Application*>(mlx)->newXpmTexture(std::string(filename), width, height);
|
||||
}
|
||||
|
||||
void* mlx_xpm_to_image(void* mlx, char** xpm_data, int* width, int* height)
|
||||
{
|
||||
return static_cast<mlx::core::Application*>(mlx)->newXpmTexture(xpm_data, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
int mlx_pixel_put(void* mlx, void* win, int x, int y, int color)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->pixelPut(win, x, y, color);
|
||||
|
||||
Reference in New Issue
Block a user