21 MESSAGE(
"Main",
"Awake",
"Application awake successfully.");
29 ERROR(
"Main",
"Run",
"Failed to initialize window.");
33 if (FAILED(
awake())) {
34 ERROR(
"Main",
"Run",
"Failed to awake application.");
39 ERROR(
"Main",
"Run",
"Failed to initialize device and device context.");
48 LARGE_INTEGER freq, prev;
49 QueryPerformanceFrequency(&freq);
50 QueryPerformanceCounter(&prev);
51 while (WM_QUIT != msg.message)
53 if (PeekMessage(&msg,
nullptr, 0, 0, PM_REMOVE))
55 TranslateMessage(&msg);
56 DispatchMessage(&msg);
61 QueryPerformanceCounter(&curr);
62 float deltaTime =
static_cast<float>(curr.QuadPart - prev.QuadPart) / freq.QuadPart;
68 return (
int)msg.wParam;
79 ERROR(
"Main",
"InitDevice",
80 (
"Failed to initialize SwpaChian. HRESULT: " + std::to_string(hr)).c_str());
88 ERROR(
"Main",
"InitDevice",
89 (
"Failed to initialize RenderTargetView. HRESULT: " + std::to_string(hr)).c_str());
97 DXGI_FORMAT_D24_UNORM_S8_UINT,
98 D3D11_BIND_DEPTH_STENCIL,
103 ERROR(
"Main",
"InitDevice",
104 (
"Failed to initialize DepthStencil. HRESULT: " + std::to_string(hr)).c_str());
111 DXGI_FORMAT_D24_UNORM_S8_UINT);
114 ERROR(
"Main",
"InitDevice",
115 (
"Failed to initialize DepthStencilView. HRESULT: " + std::to_string(hr)).c_str());
123 ERROR(
"Main",
"InitDevice",
124 (
"Failed to initialize Viewport. HRESULT: " + std::to_string(hr)).c_str());
130 std::array<std::string, 6> faces = {
131 "Skybox/cubemap_0.png",
132 "Skybox/cubemap_1.png",
133 "Skybox/cubemap_2.png",
134 "Skybox/cubemap_3.png",
135 "Skybox/cubemap_4.png",
136 "Skybox/cubemap_5.png"
147 ERROR(
"Main",
"InitDevice",
"Failed to load CyberGun model.");
153 ERROR(
"Main",
"InitDevice",
154 (
"Failed to initialize DrakePistol Texture. HRESULT: " + std::to_string(hr)).c_str());
159 ERROR(
"Main",
"InitDevice",
160 (
"Failed to initialize DrakePistol Texture. HRESULT: " + std::to_string(hr)).c_str());
165 ERROR(
"Main",
"InitDevice",
166 (
"Failed to initialize DrakePistol Texture. HRESULT: " + std::to_string(hr)).c_str());
171 ERROR(
"Main",
"InitDevice",
172 (
"Failed to initialize DrakePistol Texture. HRESULT: " + std::to_string(hr)).c_str());
177 ERROR(
"Main",
"InitDevice",
178 (
"Failed to initialize DrakePistol Texture. HRESULT: " + std::to_string(hr)).c_str());
182 if (FAILED(emissiveHr)) {
183 MESSAGE(
"Main",
"InitDevice",
"CyberGun emissive texture not found. Continuing without emissive map.");
193 ERROR(
"Main",
"InitDevice",
"Failed to create cyber Gun Actor.");
200 ERROR(
"Main",
"InitDevice",
"Failed to load Drakefire pistol model.");
206 ERROR(
"Main",
"InitDevice",
207 (
"Failed to initialize Drakefire albedo texture. HRESULT: " + std::to_string(hr)).c_str());
212 ERROR(
"Main",
"InitDevice",
213 (
"Failed to initialize Drakefire normal texture. HRESULT: " + std::to_string(hr)).c_str());
218 ERROR(
"Main",
"InitDevice",
219 (
"Failed to initialize Drakefire metallic texture. HRESULT: " + std::to_string(hr)).c_str());
224 ERROR(
"Main",
"InitDevice",
225 (
"Failed to initialize Drakefire roughness texture. HRESULT: " + std::to_string(hr)).c_str());
230 ERROR(
"Main",
"InitDevice",
231 (
"Failed to initialize Drakefire AO texture. HRESULT: " + std::to_string(hr)).c_str());
242 ERROR(
"Main",
"InitDevice",
"Failed to create Drakefire pistol Actor.");
253 builder.
Add(
"POSITION", DXGI_FORMAT_R32G32B32_FLOAT)
254 .
Add(
"NORMAL", DXGI_FORMAT_R32G32B32_FLOAT)
255 .
Add(
"TANGENT", DXGI_FORMAT_R32G32B32_FLOAT)
256 .
Add(
"BITANGENT", DXGI_FORMAT_R32G32B32_FLOAT)
257 .
Add(
"TEXCOORD", DXGI_FORMAT_R32G32_FLOAT);
262 ERROR(
"Main",
"InitDevice",
263 (
"Failed to initialize ShaderProgram. HRESULT: " + std::to_string(hr)).c_str());
270 ERROR(
"Main",
"InitDevice",
271 (
"Failed to initialize m_constantBuffer Buffer. HRESULT: " + std::to_string(hr)).c_str());
287 ERROR(
"Main",
"InitDevice",
288 (
"Failed to initialize default Rasterizer. HRESULT: " + std::to_string(hr)).c_str());
293 ERROR(
"Main",
"InitDevice",
294 (
"Failed to initialize default DepthStencilState. HRESULT: " + std::to_string(hr)).c_str());
299 ERROR(
"Main",
"InitDevice",
300 (
"Failed to initialize default SamplerState. HRESULT: " + std::to_string(hr)).c_str());
353 ERROR(
"Main",
"InitDevice",
354 (
"Failed to initialize CyberGun vertex buffer. HRESULT: " + std::to_string(hr)).c_str());
358 hr = submesh.indexBuffer.init(
m_device, meshComponent, D3D11_BIND_INDEX_BUFFER);
360 ERROR(
"Main",
"InitDevice",
361 (
"Failed to initialize CyberGun index buffer. HRESULT: " + std::to_string(hr)).c_str());
365 submesh.indexCount = meshComponent.m_numIndex;
366 submesh.materialSlot = 0;
375 ERROR(
"Main",
"InitDevice",
376 (
"Failed to initialize Drakefire vertex buffer. HRESULT: " + std::to_string(hr)).c_str());
380 hr = submesh.indexBuffer.init(
m_device, meshComponent, D3D11_BIND_INDEX_BUFFER);
382 ERROR(
"Main",
"InitDevice",
383 (
"Failed to initialize Drakefire index buffer. HRESULT: " + std::to_string(hr)).c_str());
387 submesh.indexCount = meshComponent.m_numIndex;
388 submesh.materialSlot = 0;
394 meshRenderer = EU::MakeShared<MeshRendererComponent>();
399 meshRenderer->setVisible(
true);
400 meshRenderer->setCastShadow(
true);
403 if (!drakefireMeshRenderer) {
404 drakefireMeshRenderer = EU::MakeShared<MeshRendererComponent>();
409 drakefireMeshRenderer->setVisible(
true);
410 drakefireMeshRenderer->setCastShadow(
true);
416 if (!lightComponent) {
417 lightComponent = EU::MakeShared<LightComponent>();
424 lightComponent->getLightData().intensity = 1.0f;
425 lightComponent->setCastShadow(
false);
434 ERROR(
"Main",
"InitDevice",
435 (
"Failed to initialize EditorViewportPass. HRESULT: " + std::to_string(hr)).c_str());
441 ERROR(
"Main",
"InitDevice",
442 (
"Failed to initialize ForwardRenderer. HRESULT: " + std::to_string(hr)).c_str());
452 static float t = 0.0f;
455 t += (float)XM_PI * 0.0125f;
459 static DWORD dwTimeStart = 0;
460 DWORD dwTimeCur = GetTickCount();
461 if (dwTimeStart == 0)
462 dwTimeStart = dwTimeCur;
463 t = (dwTimeCur - dwTimeStart) / 1000.0f;
467 bool show_demo_window =
true;
486 const unsigned int kMinViewportSize = 64;
488 if (desiredW < kMinViewportSize) desiredW = kMinViewportSize;
489 if (desiredH < kMinViewportSize) desiredH = kMinViewportSize;
505 const int kStableFramesRequired = 2;
530 if (lightComponent) {
548 float ClearColor[4] = { 0.1f, 0.1f, 0.1f, 1.0f };
621 CREATESTRUCT* pCreate =
reinterpret_cast<CREATESTRUCT*
>(lParam);
622 SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)pCreate->lpCreateParams);
627 BeginPaint(hWnd, &ps);
634 if (wParam == SIZE_MINIMIZED)
return 0;
636 unsigned int newW = LOWORD(lParam);
637 unsigned int newH = HIWORD(lParam);
638 if (newW == 0 || newH == 0)
return 0;
641 BaseApp* app =
reinterpret_cast<BaseApp*
>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
649 return DefWindowProc(hWnd, message, wParam, lParam);
663 if (newW == 0 || newH == 0)
return;
668 ID3D11RenderTargetView* nullRTV =
nullptr;
679 if (FAILED(hr))
return;
683 if (FAILED(hr))
return;
687 if (FAILED(hr))
return;
691 if (FAILED(hr))
return;
694 if (FAILED(hr))
return;
711 ID3D11ShaderResourceView* nullSRVs[D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT] = {};
714 D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT,
737 CreateDirectoryA(
"Saved",
nullptr);
738 return "Saved/DefaultScene.wvscene";
743 std::ofstream stream(path, std::ios::trunc);
744 if (!stream.is_open()) {
745 ERROR(
"Main",
"saveScene", (
"Failed to open scene file for writing: " + path).c_str());
749 stream <<
"WVSCENE 1\n";
750 stream <<
"ACTOR_COUNT " <<
m_actors.size() <<
"\n";
752 for (
size_t actorIndex = 0; actorIndex <
m_actors.size(); ++actorIndex) {
758 stream <<
"ACTOR " << actorIndex <<
" " << std::quoted(actor->getName()) <<
"\n";
762 const EU::Vector3& position = transform->getPosition();
763 const EU::Vector3& rotation = transform->getRotation();
765 stream <<
"POSITION " << position.
x <<
" " << position.
y <<
" " << position.
z <<
"\n";
766 stream <<
"ROTATION " << rotation.
x <<
" " << rotation.
y <<
" " << rotation.
z <<
"\n";
767 stream <<
"SCALE " << scale.
x <<
" " << scale.
y <<
" " << scale.
z <<
"\n";
772 stream <<
"VISIBLE " << (meshRenderer->isVisible() ? 1 : 0) <<
"\n";
773 stream <<
"CAST_SHADOW " << (meshRenderer->canCastShadow() ? 1 : 0) <<
"\n";
775 const std::vector<MaterialInstance*>& materials = meshRenderer->getMaterialInstances();
776 stream <<
"MATERIAL_COUNT " << materials.size() <<
"\n";
777 for (
size_t i = 0; i < materials.size(); ++i) {
779 if (!materialInstance) {
780 stream <<
"MATERIAL " << i <<
" 0 0 1 1 1 1 0 1 1 1 0.5\n";
786 const int domain = material ?
static_cast<int>(material->
getDomain()) : 0;
787 const int blendMode = material ?
static_cast<int>(material->
getBlendMode()) : 0;
789 stream <<
"MATERIAL " << i <<
" "
804 stream <<
"END_ACTOR\n";
815 stream <<
"END_SCENE\n";
816 const std::wstring pathW(path.begin(), path.end());
817 MESSAGE(
"Main",
"saveScene", L
"Saved scene to '" << pathW << L
"'")
823 std::ifstream stream(path);
824 if (!stream.is_open()) {
830 if (token !=
"WVSCENE") {
841 while (stream >> token) {
842 if (token ==
"ACTOR_COUNT") {
843 size_t ignoredCount = 0;
844 stream >> ignoredCount;
846 else if (token ==
"ACTOR") {
847 size_t actorIndex = 0;
848 std::string actorName;
849 stream >> actorIndex >> std::quoted(actorName);
852 currentActor =
m_actors[actorIndex];
854 if (!currentActor.
isNull()) {
855 currentActor->setName(actorName);
858 else if (token ==
"POSITION" && !currentActor.
isNull()) {
859 float x = 0.0f, y = 0.0f, z = 0.0f;
860 stream >> x >> y >> z;
866 else if (token ==
"ROTATION" && !currentActor.
isNull()) {
867 float x = 0.0f, y = 0.0f, z = 0.0f;
868 stream >> x >> y >> z;
874 else if (token ==
"SCALE" && !currentActor.
isNull()) {
875 float x = 1.0f, y = 1.0f, z = 1.0f;
876 stream >> x >> y >> z;
882 else if (token ==
"VISIBLE" && !currentActor.
isNull()) {
887 meshRenderer->setVisible(value != 0);
890 else if (token ==
"CAST_SHADOW" && !currentActor.
isNull()) {
895 meshRenderer->setCastShadow(value != 0);
898 else if (token ==
"MATERIAL_COUNT") {
899 size_t ignoredCount = 0;
900 stream >> ignoredCount;
902 else if (token ==
"MATERIAL" && !currentActor.
isNull()) {
903 size_t materialIndex = 0;
907 stream >> materialIndex
911 >> params.baseColor.y
912 >> params.baseColor.z
913 >> params.baseColor.w
917 >> params.normalScale
918 >> params.alphaCutoff;
922 const std::vector<MaterialInstance*>& materials = meshRenderer->getMaterialInstances();
923 if (materialIndex < materials.size() && materials[materialIndex]) {
924 materials[materialIndex]->getParams() = params;
925 Material* material = materials[materialIndex]->getMaterial();
933 else if (token ==
"LIGHT") {
943 if (lightComponent) {
949 else if (token ==
"END_ACTOR") {
952 else if (token ==
"END_SCENE") {
957 const std::wstring pathW(path.begin(), path.end());
958 MESSAGE(
"Main",
"loadScene", L
"Loaded scene from '" << pathW << L
"'")
Declara la API de BaseApp dentro del subsistema Core.
IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
#define MESSAGE(classObj, method, state)
#define ERROR(classObj, method, errorMSG)
Declara la API de ResourceManager dentro del subsistema Core.
void setName(const std::string &name)
Establece el nombre del actor.
Coordina el ciclo de vida principal de Wildvine Engine.
MaterialInstance m_drakefireMaterial
bool loadScene(const std::string &path)
Carga una escena serializada previamente.
DeviceContext m_deviceContext
unsigned int m_lastRequestedViewportWidth
Texture m_drakefireAlbedoSRV
Texture m_drakefireMetallicSRV
SamplerState m_defaultSampler
HRESULT init()
Inicializa recursos graficos, escena, materiales y renderer.
void handleEditorViewportResize()
Atiende cambios diferidos del viewport interno del editor.
DepthStencilView m_depthStencilView
int run(HINSTANCE hInst, int nCmdShow)
Ejecuta el bucle principal de la aplicacion.
void render()
Emite el frame actual en el viewport del editor y en el back buffer final.
void destroy()
Libera recursos del motor en orden seguro de destruccion.
bool saveScene(const std::string &path)
Serializa la escena actual a disco.
MaterialInstance m_cyberGunMaterial
Mesh m_cyberGunRenderMesh
std::string getDefaultScenePath() const
Devuelve la ruta por defecto usada por el editor para persistencia rapida.
int m_viewportResizeStableFrames
unsigned int m_pendingViewportHeight
RenderTargetView m_renderTargetView
Material m_transparentPbrMaterial
ForwardRenderer m_forwardRenderer
DepthStencilState m_defaultDepthStencil
EU::TSharedPointer< Actor > m_cyberGun
RasterizerState m_defaultRasterizer
RenderScene m_renderScene
EU::TSharedPointer< Actor > m_directionalLightActor
void onResize(unsigned int newW, unsigned int newH)
Reconstuye recursos dependientes de la resolucion principal.
unsigned int m_pendingViewportWidth
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
bool m_editorViewportResizePending
CBMain m_constantBufferStruct
Model3D * m_drakefireModel
EU::TSharedPointer< Actor > m_drakefirePistol
ShaderProgram m_shaderProgram
unsigned int m_lastRequestedViewportHeight
Texture m_drakefireNormalSRV
void update(float deltaTime)
Ejecuta la logica por frame y sincroniza GUI, camara y escena.
Texture m_drakefireRoughnessSRV
Mesh m_drakefireRenderMesh
HRESULT awake()
Prepara subsistemas previos al render.
EditorViewportPass m_editorViewportPass
std::vector< EU::TSharedPointer< Actor > > m_actors
HRESULT init(Device &device, const MeshComponent &mesh, unsigned int bindFlag)
Inicializa el buffer como Vertex o Index Buffer usando un MeshComponent.
XMMATRIX getView() const
Matriz View (mundo->vista).
EU::Vector3 getPosition() const
Obtiene la posición en mundo.
XMMATRIX getProj() const
Matriz Projection (vista->clip).
void setPosition(float x, float y, float z)
Define posición en mundo.
void updateViewMatrix()
Recalcula la matriz View si es necesario.
void setLens(float fovYRadians, float aspectRatio, float nearPlane, float farPlane)
Configura la proyección en perspectiva (LH).
HRESULT init(Device &device, bool depthEnable, D3D11_DEPTH_WRITE_MASK writeMask, D3D11_COMPARISON_FUNC depthFunc)
Crea el objeto ID3D11DepthStencilState a partir de flags comunes.
void destroy()
Libera el recurso ID3D11DepthStencilState y deja la instancia en estado no inicializado.
void destroy()
Libera el recurso asociado al ID3D11DepthStencilView.
HRESULT init(Device &device, Texture &depthStencil, DXGI_FORMAT format)
Inicializa el ID3D11DepthStencilView a partir de una textura de profundidad.
void render(DeviceContext &deviceContext)
Asigna la vista de profundidad/esténcil al pipeline de render.
void destroy()
Libera el recurso ID3D11DeviceContext.
ID3D11DeviceContext * m_deviceContext
Puntero al contexto inmediato de Direct3D 11.
Clase TSharedPointer para manejar la gestión de memoria compartida.
bool isNull() const
Comprobar si el puntero es nulo.
T * get() const
Obtener el puntero crudo.
float x
The x-coordinate of the vector.
float z
The z-coordinate of the vector.
float y
The y-coordinate of the vector.
ID3D11ShaderResourceView * getSRV() const
HRESULT init(Device &device, unsigned int width, unsigned int height)
unsigned int getHeight() const
void swap(EditorViewportPass &other)
unsigned int getWidth() const
void addComponent(EU::TSharedPointer< T > component)
Agrega un componente a la entidad.
EU::TSharedPointer< T > getComponent()
Obtiene un componente de la entidad por su tipo.
void resize(Device &device, unsigned int width, unsigned int height)
Reconstuye los recursos dependientes del tamano del viewport.
ID3D11ShaderResourceView * getPreShadowSRV() const
void destroy()
Libera los recursos internos del renderer.
HRESULT init(Device &device)
Inicializa buffers, shaders y estados del renderer.
ID3D11ShaderResourceView * getShadowMapSRV() const
void render(DeviceContext &deviceContext, const Camera &camera, RenderScene &scene, EditorViewportPass &viewportPass)
Renderiza la escena completa sobre el EditorViewportPass.
void editTransform(Camera &cam, Window &window, EU::TSharedPointer< Actor > actor)
void inspectorGeneral(EU::TSharedPointer< Actor > actor)
int selectedActorIndex
Indice del actor seleccionado en el outliner.
bool consumeSaveSceneRequest()
Consume de forma atomica la solicitud de guardado emitida desde la UI.
void init(Window &window, Device &device, DeviceContext &deviceContext)
Configura los backends de ImGui para Win32 y Direct3D 11.
void drawRenderDebugPanel(ID3D11ShaderResourceView *preShadowSRV, ID3D11ShaderResourceView *finalViewportSRV, ID3D11ShaderResourceView *shadowMapSRV)
void update(Viewport &viewport, Window &window)
Actualiza el frame de ImGui y el estado de la ventana del editor.
void drawViewportPanel(ID3D11ShaderResourceView *viewportSRV)
void vec3Control(const std::string &label, float *values, float resetValues=0.0f, float columnWidth=100.0f, bool displayAsDegrees=false)
ImVec2 m_viewportSize
Tamano actual del viewport del editor.
void outliner(const std::vector< EU::TSharedPointer< Actor > > &actors)
void render()
Renderiza todos los paneles activos del editor.
LayoutBuilder & Add(const char *semantic, DXGI_FORMAT format, UINT semanticIndex=0, UINT inputSlot=0, UINT alignedByteOffset=D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_CLASSIFICATION slotClass=D3D11_INPUT_PER_VERTEX_DATA, UINT instanceStepRate=0)
Agrupa un material base con sus texturas y parametros concretos.
void setNormal(Texture *texture)
void setMaterial(Material *material)
void setEmissive(Texture *texture)
Material * getMaterial() const
void setRoughness(Texture *texture)
void setAlbedo(Texture *texture)
void setAO(Texture *texture)
void setMetallic(Texture *texture)
MaterialParams & getParams()
Describe el estado fijo compartido por una o mas instancias de material.
void setSamplerState(SamplerState *state)
void setDomain(MaterialDomain domain)
void setShader(ShaderProgram *shader)
BlendMode getBlendMode() const
void setBlendMode(BlendMode blendMode)
void setRasterizerState(RasterizerState *state)
MaterialDomain getDomain() const
void setDepthStencilState(DepthStencilState *state)
Componente ECS que almacena la información de geometría (malla) de un actor.
void destroy()
Libera todos los buffers asociados a las submallas.
std::vector< Submesh > & getSubmeshes()
const std::vector< MeshComponent > & GetMeshes() const
bool load(const std::string &path) override
void destroy()
Libera el recurso ID3D11RasterizerState.
HRESULT init(Device device)
Inicializa el Rasterizer State.
Skybox * skybox
Skybox activo para el frame actual.
void clear()
Limpia todas las colecciones para preparar un nuevo frame.
void destroy()
Libera el recurso ID3D11RenderTargetView.
HRESULT init(Device &device, Texture &backBuffer, DXGI_FORMAT Format)
Inicializa el Render Target View desde el back buffer.
void render(DeviceContext &deviceContext, DepthStencilView &depthStencilView, unsigned int numViews, const float ClearColor[4])
Limpia y asigna el RTV junto con un Depth Stencil View.
HRESULT init(Device &device)
Inicializa el Sampler State con una configuración predeterminada.
void destroy()
Libera el recurso ID3D11SamplerState.
void gatherRenderScene(RenderScene &outScene, const Camera &camera)
void addEntity(Entity *e)
Registra una entidad dentro del grafo.
void update(float deltaTime, DeviceContext &deviceContext)
HRESULT init(Device &device, const std::string &fileName, LayoutBuilder layoutBuilder)
Inicializa el programa de shaders desde un archivo HLSL.
void destroy()
Libera todos los recursos asociados (shaders, blobs e input layout).
HRESULT init(Device &device, DeviceContext *deviceContext, Texture &cubemap)
void update(DeviceContext &deviceContext, Camera &camera)
HRESULT init(Device &device, DeviceContext &deviceContext, Texture &backBuffer, Window window)
Inicializa el Swap Chain y obtiene el back buffer.
void present()
Presenta el back buffer en pantalla.
IDXGISwapChain * m_swapChain
Objeto principal del Swap Chain en Direct3D 11.
void destroy()
Libera todos los recursos asociados al Swap Chain.
D3D_DRIVER_TYPE m_driverType
Tipo de driver utilizado (hardware, referencia, software, etc.).
HRESULT resizeBuffers(unsigned int width, unsigned int height)
HRESULT getBackBuffer(Texture &backBuffer)
HRESULT init(Device &device, const std::string &textureName, ExtensionType extensionType)
Inicializa una textura cargada desde archivo.
void destroy()
Libera los recursos de la textura.
HRESULT CreateCubemap(Device &device, DeviceContext &deviceContext, const std::array< std::string, 6 > &facePaths, bool generateMips)
ID3D11ShaderResourceView * m_textureFromImg
Vista de la textura como recurso de shader.
void render(DeviceContext &deviceContext)
Aplica el viewport al contexto de dispositivo.
HRESULT init(const Window &window)
Inicializa el viewport a partir de una ventana.
HRESULT init(HINSTANCE hInstance, int nCmdShow, WNDPROC wndproc, BaseApp *app)
Crea y muestra la ventana principal del motor.
unsigned int m_width
Ancho actual del area cliente.
unsigned int m_height
Alto actual del area cliente.
Describe una porcion renderizable de una malla con sus buffers asociados.
Buffer vertexBuffer
Buffer de vertices de la submalla.