Created
November 7, 2017 18:37
-
-
Save DRMD431LU/ecf5f0a6c1429c05b646819ce12fd0b6 to your computer and use it in GitHub Desktop.
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 <iostream> | |
| #include<SDL2/SDL.h> | |
| int main(int argc, char *argv[]) { | |
| SDL_Window *window= nullptr; | |
| SDL_Surface *screen; | |
| if(SDL_Init(SDL_INIT_VIDEO)<0){ | |
| std::cout<< "Todo mal\n"; | |
| return 1; | |
| } | |
| std::cout<<"Todo bien\n "; | |
| //std::cout<< "hola mundo\n"; | |
| //std::cout << argv[0]; | |
| SDL_Delay(3000); | |
| window=SDL_CreateWindow("Mi hola mundo sdl",0,0,800,600,SDL_WINDOW_SHOWN); | |
| screen=SDL_GetWindowSurface(window); | |
| while (true){ | |
| SDL_Rect cuadro; | |
| cuadro.x=50; | |
| cuadro.w=100; | |
| cuadro.y=100; | |
| cuadro.h=100; | |
| SDL_FillRect(screen, &cuadro, 0xFF); | |
| SDL_UpdateWindowSurface(window); | |
| SDL_UpdateWindowSurface(window); | |
| } | |
| SDL_DestroyWindow(window); | |
| SDL_Quit(); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment