#include <stdio.h>
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h> // only include this one in the source file with main()!#include <SDL3/SDL_render.h>
#include <SDL3/SDL_events.h>
#include <SDL3/SDL_render.h>
#include <SDL3/SDL_surface.h>
#include <SDL3/SDL_ttf.h>
#include <string.h>
#include <SDL3/SDL_rect.h >
#include <stdbool.h>
int main(int argc, char* argv[])
{
const int WIDTH = 800;
const int HEIGHT = 600;
const char* err = NULL;
bool text_input_complete = false, v;
char text[1024] = { "a"};
int cursor = 0, retour = 0;
SDL_Surface* texts = NULL;
TTF_Font* police = NULL;
SDL_Color blanc = { 0, 0, 0 };
SDL_Texture* texture = NULL;
SDL_FRect* srcrect, * dstrect;
SDL_FRect frect_dst = { 0,0,800,600 };
const SDL_FRect area = { 10,50,100,50 };
SDL_FRect rect = { 10,50,100,0 };
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
SDL_Init(SDL_INIT_VIDEO);
if (TTF_Init() == -1) {
printf("TTF init a un probléme !");
}
police = TTF_OpenFont("WsParadoseRegular-1jPAe.ttf", 12);
err = SDL_GetError();
window = SDL_CreateWindow("Ave frater", WIDTH, HEIGHT, 0);
renderer = SDL_CreateRenderer(window, NULL);
SDL_RenderPresent(renderer);
texts = TTF_RenderText_Blended(police, text, 5, blanc);
texture = SDL_CreateTextureFromSurface(renderer, texts);
v = SDL_RenderTexture(renderer, texture, NULL, NULL);
SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF);
SDL_RenderFillRect(renderer, &rect);
SDL_RenderPresent(renderer);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
Hello,
I reduced my code;
systematically texture to zero, the font is in the right directory, font is not zero.
err; is not zero.
On the other hand the ‘w’ of texts is negative
I’m stuck…
Thanks.