资源简介
基于DirectX11和xna数学库开发的游戏引擎框架,因需要积分,所以含泪共享
代码片段和文件信息
#include “stdafx.h“
#include
const int g_WindowWidth = 800;
const int g_WindowHeight = 600;
float fRad = 0.0f;
const float fSpeed = 0.0003f;
struct SpriteInfos
{
int UpKeyDownStartframe;
int UpKeyDownEndframe;
int DownKeyDownStartframe;
int DownKeyDownEndframe;
int LeftKeyDownStartframe;
int LeftKeyDownEndframe;
int RightKeyDownStartframe;
int RightKeyDownEndframe;
};
class cD3DSampleApp : public CApplication public iKeyboardReceiver public iMouseReceiver public iXInputReceiver
{
protected:
CbaseframeSprite* m_pSprite;
Cbase2DCamera* m_p2DCamera;
SpriteInfos m_Spriteframe;
public:
cD3DSampleApp() :
CApplication()
{
m_width = g_WindowWidth;
m_height = g_WindowHeight;
m_title = L“Jay Yea Engine“;
m_pSprite = new CbaseframeSprite();
m_p2DCamera = new Cbase2DCamera();
}
~cD3DSampleApp()
{
delete m_pSprite;
delete m_p2DCamera;
}
// 场景初始化
virtual void OnSceneInit();
// 场景结束销毁数据
virtual void OnSceneEnd();
// 更新场景接口
virtual void OnUpdate(float delay);
// 绘制场景接口
virtual void OnPresent();
// 闲置画面接口
virtual void OnIdleUpdate(float timeDelta);
// 闲置画面接口
virtual void OnIdlePresent();
// 键盘按键保持
virtual void onkeypress(int key);
// 键盘按键按下
virtual void onkeydown(int key);
// 键盘按键释放
virtual void onkeyup(int key);
// 鼠标按下
virtual void OnMouseButtonDown(char button);
// 鼠标按键保持
virtual void OnMouseButtonKeep(char button);
// 鼠标按键释放
virtual void OnMouseButtonUp(char button);
// 鼠标移动事件
virtual void onmousemoved(int dx int dy);
// 鼠标中间滚轮值改变
virtual void onmousewheelLenth(long mouseWheelLenth);
// XBOX360设备按键信息发生变化
virtual void OnXInputKeyChange();
};
CApplication* CreateApplication()
{
return new cD3DSampleApp();
}
void DestroyApplication(CApplication* pApp)
{
delete pApp;
}
void cD3DSampleApp::OnSceneInit()
{
ChangeWindowFactor();
Input()->GetKeyboard()->SetReceiver(this);
Input()->GetMouse()->SetReceiver(this);
if (Input()->GetXInput())
{
Input()->GetXInput()->SetReceiver(this);
}
Graphics()->InitDefaultShader();
m_Spriteframe.DownKeyDownStartframe = 0;
m_Spriteframe.DownKeyDownEndframe = 3;
m_Spriteframe.LeftKeyDownStartframe = 4;
m_Spriteframe.LeftKeyDownEndframe = 7;
m_Spriteframe.RightKeyDownStartframe = 8;
m_Spriteframe.RightKeyDownEndframe = 11;
m_Spriteframe.UpKeyDownStartframe = 12;
m_Spriteframe.UpKeyDownEndframe = 15;
GetGameFontSystem()->ChangeDrawText(L“Jay Engine“ 1.0f 0.0f XMFLOAT4(0.0f 1.0f 1.0f 1.0f));
m_pSprite->LoadTextureFromFile(L“04_G.png“);
m_pSprite->SetSize(32.0f 48.0f);
m_pSprite->InitUVframeSize(32.0f 48.0f);
m_pSprite->SetSpriteListAnimationData(4 4 0 3 1 0.25f);
m_pSprite->UpdateScaling(1.0f 1.0f);
m_pSprite->UpdatePosition(200.0f 100.0f);
m_p2DCamera->Init();
m_pSprite->Regist2DCamera(m_p2DCamera);
m_pSprite->Init();
}
void cD3DSampleApp::OnScen
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5005 2013-11-15 10:03 EngineSystem\03.png
文件 5827 2013-11-15 10:03 EngineSystem\04_G.png
文件 165376 2018-09-17 20:54 EngineSystem\Bin\Debug\x86\EngineSystem.exe
文件 4123648 2018-09-17 20:54 EngineSystem\Bin\Debug\x86\EngineSystem.pdb
文件 2812 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.Build.CppClean.log
文件 28442624 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.pch
文件 3356 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.res
文件 760 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\cl.command.1.tlog
文件 37510 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\CL.read.1.tlog
文件 648 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\CL.write.1.tlog
文件 198 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\EngineSystem.lastbuildstate
文件 2578 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\EngineSystem.write.1u.tlog
文件 808 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\FXC.command.1.tlog
文件 700 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\fxc.read.1.tlog
文件 522 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\fxc.write.1.tlog
文件 1296 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\li
文件 5620 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\li
文件 562 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\li
文件 500 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\rc.command.1.tlog
文件 2302 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\rc.read.1.tlog
文件 262 2018-08-29 16:32 EngineSystem\Bin\Debug\x86tlog\EngineSystem.tlog\rc.write.1.tlog
文件 1025392 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\main.obj
文件 1043456 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\vc120.idb
文件 2510848 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\vc120.pdb
文件 1947 2018-09-17 20:54 EngineSystem\Bin\Debug\x86tlog\窗口化测试程序.log
文件 2572 2018-08-29 16:31 EngineSystem\Bin\Release\x86\DefaultPixelShader.cso
文件 1028 2018-08-29 16:31 EngineSystem\Bin\Release\x86\DefaultVertexShader.cso
文件 227840 2018-08-29 16:31 EngineSystem\Bin\Release\x86\EngineSystem.exe
文件 4795392 2018-08-29 16:31 EngineSystem\Bin\Release\x86\EngineSystem.pdb
文件 2777 2018-08-29 16:31 EngineSystem\Bin\Release\x86tlog\EngineSystem.Build.CppClean.log
............此处省略226个文件信息
评论
共有 条评论