GCC ready. Removed VS Project. Removed stb_image
This commit is contained in:
14
debug.cpp
14
debug.cpp
@@ -1,8 +1,7 @@
|
||||
#include "debug.h"
|
||||
#include <SDL.h>
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include "parser.h"
|
||||
#include "font_bmp.h"
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
@@ -299,14 +298,19 @@ void debug_show_window() {
|
||||
debug_window_id = SDL_GetWindowID(debug_window);
|
||||
SDL_SetRenderDrawColor(debug_renderer, 128, 128, 128, 255);
|
||||
|
||||
FILE* f = fopen("font.png", "rb");
|
||||
// [RZC 15-04-2021] Old version using PNG
|
||||
/*FILE* f = fopen("font.png", "rb");
|
||||
int x = 128, y = 128, c;
|
||||
Uint8* buffer = stbi_load_from_file(f, &x, &y, &c, 4);
|
||||
debug_texture = SDL_CreateTexture(debug_renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, 128, 128);
|
||||
SDL_UpdateTexture(debug_texture, NULL, buffer, 128 * sizeof(Uint32));
|
||||
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_BLEND);
|
||||
stbi_image_free(buffer);
|
||||
fclose(f);
|
||||
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_BLEND);*/
|
||||
|
||||
// [RZC 15-04-2021] New version using 1 bit BMP
|
||||
debug_texture = SDL_CreateTextureFromSurface(debug_renderer, SDL_LoadBMP_RW(SDL_RWFromMem(font_bmp, font_bmp_len), 1));
|
||||
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_ADD);
|
||||
visible = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user