SDL_CreateWindow函数
来源:互联网 发布:百度的域名值多少钱 编辑:程序博客网 时间:2024/06/05 20:00
SDL_CreateWindow函数:
用此函数在指定的位置,指定窗口大小,以及相应标志来创建窗口。
定义:
SDL_Window* SDL_CreateWindow(const char* title, int x, int y, int w, int h, Uint32 flags)
函数参数:
title
the title of the window, in UTF-8 encoding
x
the x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
y
the y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
w
the width of the window, in screen coordinates
h
the height of the window, in screen coordinates
flags
0, or one or more SDL_WindowFlags OR'd together; see Remarks for details
例子:
#include "SDL.h"#include <stdio.h>int main(int argc, char* argv[]) { SDL_Window *window; // Declare a pointer SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2 // Create an application window with the following settings: window = SDL_CreateWindow( "An SDL2 window", // window title SDL_WINDOWPOS_UNDEFINED, // initial x position SDL_WINDOWPOS_UNDEFINED, // initial y position 640, // width, in pixels 480, // height, in pixels SDL_WINDOW_OPENGL // flags - see below ); // Check that the window was successfully created if (window == NULL) { // In the case that the window could not be made... printf("Could not create window: %s\n", SDL_GetError()); return 1; } // The window is open: could enter program loop here (see SDL_PollEvent()) SDL_Delay(3000); // Pause execution for 3000 milliseconds, for example // Close and destroy the window SDL_DestroyWindow(window); // Clean up SDL_Quit(); return 0;}
蔡军生
跟老菜鸟学C++
http://edu.csdn.net/course/detail/2901
0 0
- SDL_CreateWindow函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- C++ 引用计数器
- [JAVA] Swing 边框用法
- 安卓接入微信支付解析,细数开发过程中遇到的坑
- C/C++——网络开发
- maven 启动 报错 Fatal error compiling: 无效的目标发行版
- SDL_CreateWindow函数
- 浅谈算法和数据结构: 四 快速排序
- iOS "xxxx" file not found
- 使用 Order By字句对查询结果进行排序
- poj_1286 Necklace of Beads(置换群Polya定理)
- 使用BusyBox解决adb shell命令无法使用awk等命令的问题
- Uva815 Flood
- 流媒体基本要点简述:如何在H264数据中获取PTS?
- JetBrains 2016.3系列,屌丝福利