#include <SDL.h> #include <stdio.h> int main(int argc, char* argv[]) { if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("SDL could not initialize! SDL Error: %s\n", SDL_GetError()); return 1; } SDL_Window *window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEF...
Lesson 8: Timers第八节:计时器 转自:http://adolfans.github.io/sdltutorialcn/sdl-2-dot-0-tutorial-index/
cmake_minimum_required(VERSION3.0.0)project(aaa VERSION0.1.0)include(CTest)enable_testing()add_executable(aaa main.cpp)target_link_libraries(aaa mingw32)target_link_libraries(aaa SDL2main)target_link_libraries(aaa SDL2)set(CPACK_PROJECT_NAME ${PROJECT_NAME})set(CPACK_PROJECT_VERSION ${PROJECT...
success =false; }else{//创建 windowgWindow = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );if( gWindow == NULL ) {printf("Window could not be created! SDL_Error: %s\n", SDL_GetError() ); success ...
SDL_Error:%s\n",SDL_GetError());}else{//创建 windowwindow=SDL_CreateWindow("SDLTutorial",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,SCREEN_WIDTH,SCREEN_HEIGHT,SDL_WINDOW_SHOWN);if(window==NULL){printf("Window could not be created!SDL_Error:%s\n",SDL_GetError());}else{//获取 ...
}//Create windowwindow = SDL_CreateWindow("SDL Tutorial", mRect.x, mRect.y, mRect.w, mRect.h, SDL_WINDOW_SHOWN/**| SDL_WINDOW_BORDERLESS 取消sdl_window边框*/);if(window ==NULL) {printf("Window could not be created! SDL Error: %s\n", SDL_GetError());return; ...
boolinit(){//初始化标志bool success=true;//初始化SDLif(SDL_Init(SDL_INIT_VIDEO)<0){printf("SDL could not initialize! SDL_Error: %s\n",SDL_GetError());success=false;}else{//创建窗口gWindow=SDL_CreateWindow("SDL Tutorial",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,SCREEN_WIDTH,SCREE...
SDL_Error: %s\n", SDL_GetError()); } else { //创建 window window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN); if (window == NULL) { printf("Window could not be created! SDL_Error: %s\n", ...
window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN ); if( window == NULL ) { printf( "Window could not be created! SDL_Error: %sn", SDL_GetError() ); ...
window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 500, 300, SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS); if (window == NULL) { printf("Window could not be created! SDL Error: %s\n", SDL_GetError()); ...