自己设计的游戏引擎项目


基于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  EngineSystem3.png

     文件       5827  2013-11-15 10:03  EngineSystem4_G.png

     文件     165376  2018-09-17 20:54  EngineSystemBinDebugx86EngineSystem.exe

     文件    4123648  2018-09-17 20:54  EngineSystemBinDebugx86EngineSystem.pdb

     文件       2812  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.Build.CppClean.log

     文件   28442624  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.pch

     文件       3356  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.res

     文件        760  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tlogcl.command.1.tlog

     文件      37510  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tlogCL.read.1.tlog

     文件        648  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tlogCL.write.1.tlog

     文件        198  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tlogEngineSystem.lastbuildstate

     文件       2578  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tlogEngineSystem.write.1u.tlog

     文件        808  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.tlogFXC.command.1.tlog

     文件        700  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.tlogfxc.read.1.tlog

     文件        522  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.tlogfxc.write.1.tlog

     文件       1296  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tloglink.command.1.tlog

     文件       5620  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tloglink.read.1.tlog

     文件        562  2018-09-17 20:54  EngineSystemBinDebugx86tlogEngineSystem.tloglink.write.1.tlog

     文件        500  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.tlog
c.command.1.tlog

     文件       2302  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.tlog
c.read.1.tlog

     文件        262  2018-08-29 16:32  EngineSystemBinDebugx86tlogEngineSystem.tlog
c.write.1.tlog

     文件    1025392  2018-09-17 20:54  EngineSystemBinDebugx86tlogmain.obj

     文件    1043456  2018-09-17 20:54  EngineSystemBinDebugx86tlogvc120.idb

     文件    2510848  2018-09-17 20:54  EngineSystemBinDebugx86tlogvc120.pdb

     文件       1947  2018-09-17 20:54  EngineSystemBinDebugx86tlog窗口化测试程序.log

     文件       2572  2018-08-29 16:31  EngineSystemBinReleasex86DefaultPixelShader.cso

     文件       1028  2018-08-29 16:31  EngineSystemBinReleasex86DefaultVertexShader.cso

     文件     227840  2018-08-29 16:31  EngineSystemBinReleasex86EngineSystem.exe

     文件    4795392  2018-08-29 16:31  EngineSystemBinReleasex86EngineSystem.pdb

     文件       2777  2018-08-29 16:31  EngineSystemBinReleasex86tlogEngineSystem.Build.CppClean.log

............此处省略226个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)