This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL.h> | |
#include <stdio.h> | |
// Macros used to keep the box within the screen's boundaries. In C++ std::min and std::max can be used. | |
#define MIN(a,b) (((a)<(b))?(a):(b)) | |
#define MAX(a,b) (((a)>(b))?(a):(b)) | |
// This is the forward declaration for shutdown so that main() knows it exists, check below main() for the function | |
// body. | |
int shutdown(SDL_Window* main_window, SDL_Renderer* renderer, const char* error_prefix, const char* error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL.h> | |
#include <SDL_ttf.h> | |
#include <iostream> | |
int main(int argc, char* argv[]) | |
{ | |
const std::string app_title = "SDL_TextBoxExample"; | |
const SDL_Color background_color = SDL_Color{ 0, 50, 255, 255 }; | |
const SDL_Color foreground_color = SDL_Color{ 255, 255, 255, 255 }; | |
const SDL_Rect window_rect = SDL_Rect{ SDL_WINDOWPOS_CENTERED , SDL_WINDOWPOS_CENTERED , 1280, 720 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL.h> | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <algorithm> | |
#include <format> | |
int main(int argc, char* argv[]) | |
{ | |
std::string app_title = "SDL Box Example"; |
OlderNewer