日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

生命游戏c语言代码easy,c++生命游戏源码

發布時間:2023/12/20 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 生命游戏c语言代码easy,c++生命游戏源码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

該樓層疑似違規已被系統折疊?隱藏此樓查看此樓

glViewport( 0, 0, width, height );

glMatrixMode( GL_PROJECTION );

glLoadIdentity( );

}

//程序入口

int main(int argc, char *argv[])

{

//隨機生成細胞的狀態

MapRand();

std::cout<

//SDL初始化

const SDL_VideoInfo* info = NULL;

int width = 0;

int height = 0;

int bpp = 0;

int flags = 0;

if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {

fprintf( stderr, "Video initialization failed: %s\n",

SDL_GetError( ) );

quit_tutorial( 1 );

}

info = SDL_GetVideoInfo( );

if( !info ) {

fprintf( stderr, "Video query failed: %s\n",

SDL_GetError( ) );

quit_tutorial( 1 );

}

width = 1024;

height = 768;

bpp = info->vfmt->BitsPerPixel;

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 24 );

SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 24 );

SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 24 );

SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );

SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

flags = SDL_OPENGL | SDL_FULLSCREEN;

if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {

fprintf( stderr, "Video mode set failed: %s\n",

SDL_GetError( ) );

quit_tutorial( 1 );

}

//初始化OpenGL

setup_opengl( width, height );

//進入消息循環

SDL_Process();

//退出程序

quit_tutorial( 0 );

return 0;

}

void SDL_Process()

{

bool gameOver = false;

while( !gameOver )

{

SDL_Event gameEvent;

SDL_PollEvent(&gameEvent);

if ( &gameEvent != 0 )

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的生命游戏c语言代码easy,c++生命游戏源码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。