public FileManager filemanager; //本地资源管理器[1.0] public Form1() { InitializeComponent(); //初始化bass库 BassNet.Registration("*****@*****.**", "2X52314160022"); this.Text = "Stay Night"; _fastloop = new FastLoop(GameLoop); //绑定循环 //lp = new LoopTread(this); //loopthread = new LoopTread(GameLoop); _openGLControl.Dock = DockStyle.Fill; //保持为父容器填充 _openGLControl.InitializeContexts(); //OpenGL初始化(比c++方便了不少) filemanager = new FileManager(); LoadingSetting(); //读取用户设置 InitializeDisplay(); //读取资源 InitializeSounds(); InitializeTextures(); //角色初始化 InitializeGameCharactors(); //游戏场景 InitializeGameState(); Gl.glDepthMask(Gl.GL_TRUE); //设置深度缓冲为可读可写 //glDepthMask(GL_FALSE);可将深度缓冲区设置为只读形式 //键盘控制初始 InitializeKeyManager(); Gl.glEnable(Gl.GL_TEXTURE_2D); _system.ChangeState("BattleStage1"); // _system.ChangeState("Stage1"); _openGLControl.KeyDown += _openGLControl_KeyDown; _openGLControl.KeyUp += _openGLControl_KeyUp; // _openGLControl.AutoCheckErrors = true; //自动处理错误 _openGLControl.AutoFinish = true; //自动finish _openGLControl.AutoSwapBuffers = true; //Thread loop = new Thread(new ThreadStart(Read)); //loop.Start(); }
TextureManager _textureManager = new TextureManager(); //纹理管理器 #endregion Fields #region Constructors public Form1() { InitializeComponent(); //初始化bass库 BassNet.Registration("*****@*****.**", "2X52314160022"); this.Text = "Stay Night" ; _fastloop = new FastLoop(GameLoop); //绑定循环 //lp = new LoopTread(this); //loopthread = new LoopTread(GameLoop); _openGLControl.Dock = DockStyle.Fill; //保持为父容器填充 _openGLControl.InitializeContexts(); //OpenGL初始化(比c++方便了不少) filemanager = new FileManager(); LoadingSetting(); //读取用户设置 InitializeDisplay(); //读取资源 InitializeSounds(); InitializeTextures(); //角色初始化 InitializeGameCharactors(); //游戏场景 InitializeGameState(); Gl.glDepthMask(Gl.GL_TRUE); //设置深度缓冲为可读可写 //glDepthMask(GL_FALSE);可将深度缓冲区设置为只读形式 //键盘控制初始 InitializeKeyManager(); Gl.glEnable(Gl.GL_TEXTURE_2D); _system.ChangeState("BattleStage1"); // _system.ChangeState("Stage1"); _openGLControl.KeyDown += _openGLControl_KeyDown; _openGLControl.KeyUp += _openGLControl_KeyUp; // _openGLControl.AutoCheckErrors = true; //自动处理错误 _openGLControl.AutoFinish = true; //自动finish _openGLControl.AutoSwapBuffers = true; //Thread loop = new Thread(new ThreadStart(Read)); //loop.Start(); }