this is my code
#include "Proof.h"
#include <iostream>
#include <fstream>
#include <string>
#include <wrl/client.h>
#include <DirectXMath.h>
#include <d3d11.h>
#include <DXGI.h>
#include <d3dcompiler.h>
#include <DirectXTex.h>
#include <atlbase.h> // Necesario para usar CComPtr
#pragma comment(lib, "d3d11.lib")
#pragma comment(lib, "d3dcompiler.lib")
#pragma comment(lib, "DirectXTex.lib")
#pragma comment (lib, "DXGI.lib")
using namespace DirectX;
using Microsoft::WRL::ComPtr;
LRESULT CALLBACK WindPro(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
) {
switch (uMsg) {
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
return 0;
}
// input / output File
std::string ReadShaderFile(const std::string& filePath) {
std::ifstream file(filePath);
if (!file.is_open()) {
MessageBoxA(nullptr, ("Error al abrir el archivo: " + filePath).c_str(), "Error", MB_ICONERROR);
return "";
}
std::string content((std::istreambuf_iterator<char>(file)),
(std::istreambuf_iterator<char>()));
return content;
}
int APIENTRY WinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow
) {
const wchar_t* ventana = L"ventana";
WNDCLASSEX wcx = {};
wcx.hInstance = hInstance;
wcx.lpszClassName = ventana;
wcx.lpfnWndProc = reinterpret_cast<WNDPROC>(WindPro);
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.style = CS_HREDRAW | CS_VREDRAW;
wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcx.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcx.lpszMenuName = NULL;
RegisterClassEx(&wcx);
HWND hwnd = CreateWindowExW(
0,
ventana,
L"Game",
WS_OVERLAPPEDWINDOW,
0,
0,
1500,
850,
NULL,
NULL,
hInstance,
NULL
);
//Pointers
const D3D_FEATURE_LEVEL level = D3D_FEATURE_LEVEL_11_0;
D3D_FEATURE_LEVEL levels[] = {
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_11_0
};
IDXGIAdapter* pAdapter = nullptr;
IDXGISwapChain* pSwapChain = nullptr;
ID3D11Device* pDevice = nullptr;
ID3D11DeviceContext* pDeviceContext = nullptr;
//Pointers
ID3D11Buffer* pBuffer_Cubo = nullptr;
ID3D11ShaderResourceView* pShaderResourceView_Cubo = nullptr;
ID3D11RenderTargetView* pRenderTargetView_Cubo = nullptr;
ID3D11DepthStencilView* pDepthStencilView_Cubo = nullptr;
ID3D11SamplerState* pSamplerState_Cubo = nullptr;
ID3D11Resource* pResource_Cubo = nullptr;
//
ID3D11PixelShader* pPixelShader = nullptr;
ID3D11VertexShader* pVertexShader = nullptr;
//
ID3D11InputLayout* pPlayoutDesc = nullptr;
//SWAP_CHAIN_DESC
DXGI_SWAP_CHAIN_DESC scd = {};
ZeroMemory(&scd, sizeof(scd));
scd.BufferCount = 1;
scd.SampleDesc.Count = 1;
scd.SampleDesc.Quality = 0;
scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
scd.BufferDesc.Width = 1500;
scd.BufferDesc.Height = 850;
scd.BufferDesc.RefreshRate.Numerator = 60;
scd.BufferDesc.RefreshRate.Denominator = 1;
scd.OutputWindow = hwnd;
scd.Windowed = TRUE;
//CreateDeviceAndSwapChain
HRESULT result = D3D11CreateDeviceAndSwapChain(
pAdapter,
D3D_DRIVER_TYPE_HARDWARE,
0,
NULL,
&level,
1,
D3D11_SDK_VERSION,
&scd,
&pSwapChain,
&pDevice,
levels,
&pDeviceContext
);
if (FAILED(result)) {
MessageBox(hwnd, L"Error CreateDeviceAndSwapChain failed", L"Error", NULL);
return 1;
}
result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (FAILED(result)) {
MessageBox(hwnd, L"Error CoInitializeEx", L"Error", MB_OK | MB_ICONERROR);
CoUninitialize();
};
// error
//Image
const wchar_t* Cubo_File = L"C:\\Users\\aleja\\Pictures\\Game\\C.jpg";
Read(Cubo_File);
DirectX::TexMetadata info;
DirectX::ScratchImage Image;
result = DirectX::LoadFromWICFile(
Cubo_File,
DirectX::WIC_FLAGS_NONE,
&info,
Image,
nullptr);
if (FAILED(result)) {
MessageBox(hwnd, L"Error LoadTexture", L"Error", MB_OK | MB_ICONERROR);
return 1;
};
result = DirectX::CreateTexture(
pDevice,
Image.GetImages(),
Image.GetImageCount(),
Image.GetMetadata(),
&pResource_Cubo);
if (FAILED(result)) {
MessageBox(hwnd, L"Error CreateTexture", L"Error", MB_OK | MB_ICONERROR);
return 1;
};
////
ID3D11Texture2D* pTexture2d_Cubo = nullptr;
result = pSwapChain->GetBuffer(
0,
__uuidof(ID3D11Texture2D),
(LPVOID*)&pTexture2d_Cubo);
if (FAILED(result)) {
MessageBox(hwnd, L"Error SwapChain GetBuffer failed", L"Error", NULL);
return 1;
}
// SAMPLER_DESC
D3D11_SAMPLER_DESC SAMPLER_DESC_Cubo = {};
SAMPLER_DESC_Cubo.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
SAMPLER_DESC_Cubo.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
SAMPLER_DESC_Cubo.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
SAMPLER_DESC_Cubo.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; // Filtro lineal
SAMPLER_DESC_Cubo.MaxAnisotropy = 1; // Nivel de anisotropía
SAMPLER_DESC_Cubo.ComparisonFunc = D3D11_COMPARISON_NEVER; // No se realiza comparación
SAMPLER_DESC_Cubo.MinLOD = 0; // Nivel mínimo de detalle
SAMPLER_DESC_Cubo.MaxLOD = D3D11_FLOAT32_MAX; // Nivel máximo de detalle
// CreateSamplerState
result = pDevice->CreateSamplerState(
&SAMPLER_DESC_Cubo,
&pSamplerState_Cubo);
if (FAILED(result)) {
MessageBox(hwnd, L"Error Sampler", L"Error", MB_OK | MB_ICONERROR);
return -1;
}
DirectX::XMFLOAT4X4 Model;
DirectX::XMFLOAT4X4 View;
DirectX::XMFLOAT4X4 Projection;
DirectX::XMMATRIX translationMatrix = DirectX::XMMatrixTranslation(0.0f, 0.0f, 0.0f);
DirectX::XMStoreFloat4x4(&Model, translationMatrix);
DirectX::XMVECTOR eyePosition = DirectX::XMVectorSet(0.0f, 0.0f, -1.0f, 1.0f);
DirectX::XMVECTOR focusPoint = DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 1.0f);
DirectX::XMVECTOR upDirection = DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 1.0f);
DirectX::XMMATRIX viewMatrix = DirectX::XMMatrixLookAtLH(eyePosition, focusPoint, upDirection);
DirectX::XMStoreFloat4x4(&View, viewMatrix);
float fovY = 60.0f; // Ángulo de visión vertical de 60 grados
float aspectRatio = 1500.0f / 850; // Calcula la relación de aspecto
float fieldOfView = DirectX::XMConvertToRadians(fovY); // Convierte el campo de visión a radianes
float nearPlane = 0.1f; // Distancia del plano cercano
float farPlane = 1000.0f; // Distancia del plano lejano
DirectX::XMMATRIX projectionMatrix = DirectX::XMMatrixPerspectiveFovLH(fieldOfView, aspectRatio, nearPlane, farPlane);
DirectX::XMStoreFloat4x4(&Projection, projectionMatrix);
////
struct Cubo {
DirectX::XMFLOAT4 posicion;
DirectX::XMFLOAT2 texcoord;
};
Cubo cubo[] = {
{ XMFLOAT4(-0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 0.0f) }, // frontal 1
{ XMFLOAT4(0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 1.0f) }, // frontal 2
{ XMFLOAT4(-0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 0.0f) }, // Right 1
{ XMFLOAT4(0.5f, -0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(0.5f, -0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 1.0f) }, // Right 2
{ XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(-0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 0.0f) }, // Back 1
{ XMFLOAT4(-0.5f, -0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, -0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 1.0f) }, // Back 2
{ XMFLOAT4(0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(-0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(-0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 0.0f) }, // Left 1
{ XMFLOAT4(-0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, -0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 1.0f) }, // Left 2
{ XMFLOAT4(-0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(-0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 0.0f) }, // Up 1
{ XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 1.0f) }, // Up 2
{ XMFLOAT4(-0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(-0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) },
{ XMFLOAT4(0.5f, 0.5f, 0.5f, 1.0f), XMFLOAT2(1.0f, 0.0f) }, // Down 1
{ XMFLOAT4(0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(0.5f, 0.5f, -0.5f, 1.0f), XMFLOAT2(1.0f, 1.0f) },
{ XMFLOAT4(-0.5f, -0.5f, -0.5f, 1.0f), XMFLOAT2(0.0f, 1.0f) }, // Down 2
{ XMFLOAT4(-0.5f, -0.5f, 0.5f, 1.0f), XMFLOAT2(0.0f, 0.0f) }
};
//BUFFER_DESC
D3D11_BUFFER_DESC BD_Cubo = {};
BD_Cubo.Usage = D3D11_USAGE_DEFAULT;
BD_Cubo.ByteWidth = sizeof(Cubo) * 36;
BD_Cubo.BindFlags = D3D11_BIND_VERTEX_BUFFER; //D3D11_BIND_CONSTANT_BUFFER;
BD_Cubo.CPUAccessFlags = 0;
BD_Cubo.MiscFlags = 0;
//SUBRESOURCE_DATA
D3D11_SUBRESOURCE_DATA Data_Cubo = {};
Data_Cubo.pSysMem = cubo;
Data_Cubo.SysMemPitch = 0;
Data_Cubo.SysMemSlicePitch = 0;
//CreateBuffer
result = pDevice->CreateBuffer(
&BD_Cubo,
&Data_Cubo,
&pBuffer_Cubo
);
if (FAILED(result)) {
MessageBox(hwnd, L"Error CreateBuffer failed", L"Error", NULL);
return 1;
};
//TEXTURE2D_DESC
D3D11_TEXTURE2D_DESC Texture2dDes_Cubo = {};
Texture2dDes_Cubo.Width = 630;
Texture2dDes_Cubo.Height = 630;
Texture2dDes_Cubo.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
Texture2dDes_Cubo.MipLevels = 1;
Texture2dDes_Cubo.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
Texture2dDes_Cubo.ArraySize = 1;
Texture2dDes_Cubo.SampleDesc.Count = 1;
Texture2dDes_Cubo.SampleDesc.Quality = 0;
Texture2dDes_Cubo.Usage = D3D11_USAGE_DEFAULT;
Texture2dDes_Cubo.BindFlags = D3D11_BIND_RENDER_TARGET|D3D11_BIND_SHADER_RESOURCE;
Texture2dDes_Cubo.CPUAccessFlags = 0;
Texture2dDes_Cubo.MiscFlags = 0;
//SUBRESOURCE_DATA
D3D11_SUBRESOURCE_DATA DataTexture2d_Cubo = {};
DataTexture2d_Cubo.pSysMem = Image.GetPixels(); // Obtén los píxeles de la imagen
DataTexture2d_Cubo.SysMemPitch = static_cast<UINT>(Image.GetMetadata().width * DirectX::BitsPerPixel(Image.GetMetadata().format) / 8);
DataTexture2d_Cubo.SysMemSlicePitch = static_cast<UINT>(Image.GetPixelsSize());
//CreateTexture2D
result = pDevice->CreateTexture2D(
&Texture2dDes_Cubo,
&DataTexture2d_Cubo,
&pTexture2d_Cubo
);
if (FAILED(result)) {
MessageBox(hwnd, L"Error CreateTexture2D failed", L"Error", NULL);
return 1;
};
//
D3D11_SHADER_RESOURCE_VIEW_DESC SRV_Cubo = {};
SRV_Cubo.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
SRV_Cubo.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
SRV_Cubo.Texture2D.MipLevels = 1;
result = pDevice->CreateShaderResourceView(
pResource_Cubo,
&SRV_Cubo,
&pShaderResourceView_Cubo);
if (FAILED(result)) {
MessageBox(hwnd, L"Error creating CreateShaderResourceView", L"Error", NULL);
return 1;
}
// RENDER_TARGET_VIEW_DESC
D3D11_RENDER_TARGET_VIEW_DESC RTV_Cubo = {};
RTV_Cubo.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
RTV_Cubo.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
RTV_Cubo.Texture2D.MipSlice = 0;
// CreateRenderTargetView
result = pDevice->CreateRenderTargetView(
pTexture2d_Cubo,
&RTV_Cubo,
&pRenderTargetView_Cubo);
if (FAILED(result)) {
MessageBox(hwnd, L"Error creating render target view", L"Error", NULL);
return 1;
}
//Compilers
std::string pixelShaderFilePath = "C:\\Users\\aleja\\source\\repos\\Game\\PixelShader.hlsl";
std::string vertexShaderFilePath = "C:\\Users\\aleja\\source\\repos\\Game\\VertexShader.hlsl";
std::string pixelShaderSource_Tetrahedron = ReadShaderFile(pixelShaderFilePath);
std::string vertexShaderSource_Tetrahedron = ReadShaderFile(vertexShaderFilePath);
ID3D10Blob* pPSBlob = nullptr;
ID3D10Blob* pErrorBlob = nullptr;
result = D3DCompile(
pixelShaderSource_Tetrahedron.c_str(),
pixelShaderSource_Tetrahedron.size(),
nullptr,
nullptr,
nullptr,
"main",
"ps_5_0",
0,
0,
&pPSBlob,
&pErrorBlob);
if (FAILED(result)) {
if (pErrorBlob) {
OutputDebugStringA(reinterpret_cast<const char*>(pErrorBlob->GetBufferPointer()));
pErrorBlob->Release();
}
MessageBox(nullptr, L"Error al compilar el Pixel Shader.", L"Error", MB_ICONERROR);
return 1;
}
result = pDevice->CreatePixelShader(
pPSBlob->GetBufferPointer(),
pPSBlob->GetBufferSize(),
nullptr,
&pPixelShader);
pPSBlob->Release();
if (FAILED(result)) {
MessageBox(nullptr, L"Error al crear el Pixel Shader.", L"Error", MB_ICONERROR);
return 1;
}
ID3D10Blob* pVSBlob = nullptr;
ID3D10Blob* pErrorBlobVS = nullptr;
result = D3DCompile(
vertexShaderSource_Tetrahedron.c_str(),
vertexShaderSource_Tetrahedron.size(),
nullptr,
nullptr,
nullptr,
"main",
"vs_5_0",
0,
0,
&pVSBlob,
&pErrorBlobVS);
if (FAILED(result)) {
if (pErrorBlobVS) {
OutputDebugStringA(reinterpret_cast<const char*>(pErrorBlobVS->GetBufferPointer()));
pErrorBlobVS->Release();
}
MessageBox(nullptr, L"Error al compilar el Vertex Shader.", L"Error", MB_ICONERROR);
return 1;
};
result = pDevice->CreateVertexShader(
pVSBlob->GetBufferPointer(),
pVSBlob->GetBufferSize(),
nullptr,
&pVertexShader);
if (FAILED(result)) {
MessageBox(nullptr, L"Error al crear el Vertex Shader.", L"Error", MB_ICONERROR);
return 1;
};
D3D11_INPUT_ELEMENT_DESC layoutDesc[] = {
{"POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
{"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 16, D3D11_INPUT_PER_VERTEX_DATA, 0}
};
result = pDevice->CreateInputLayout(
layoutDesc,
_countof(layoutDesc),
pVSBlob->GetBufferPointer(),
pVSBlob->GetBufferSize(),
&pPlayoutDesc
);
ShowWindow(hwnd, nCmdShow);
// vista
D3D11_VIEWPORT vp = {};
vp.Width = 1500.0f;
vp.Height = 850.0f;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
vp.TopLeftX = 0;
vp.TopLeftY = 0;
pDeviceContext->RSSetViewports(1, &vp);
MSG msg = {};
while (msg.message != WM_QUIT) {
if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else {
// Índice de inicio de la ranura de recursos de sombreador
UINT startSlot = 0;
// Número de ranuras de recursos de sombreador que se van a establecer
UINT numViews = 1;
UINT stride = sizeof(Cubo);
UINT offset = 0;
float clearColor[4] = { 1.0f, 1.0f, 0.0f, 1.0f };
pDeviceContext->ClearRenderTargetView(pRenderTargetView_Cubo, clearColor);
//pDeviceContext->UpdateSubresource(pBuffer_Cubo, 0, nullptr, &pBuffer_Cubo, 0, 0);
pDeviceContext->PSSetSamplers(0, 1, &pSamplerState_Cubo);
//pDeviceContext->VSSetConstantBuffers(0, 1, &pBuffer_Cubo);
pDeviceContext->IASetVertexBuffers(0, 1, &pBuffer_Cubo, &stride, &offset);
pDeviceContext->VSSetShader(pVertexShader, nullptr, 0);
pDeviceContext->PSSetShader(pPixelShader, nullptr, 0);
pDeviceContext->IASetInputLayout(pPlayoutDesc);
pDeviceContext->PSSetShaderResources(startSlot, numViews, &pShaderResourceView_Cubo);
pDeviceContext->OMSetRenderTargets(1, &pRenderTargetView_Cubo, nullptr);
pDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
pDeviceContext->Draw(36, 0);
pSwapChain->Present(1, 0);
}
}
if (pAdapter) { pAdapter->Release(); };
if (pSwapChain) { pSwapChain->Release(); };
if (pDevice) { pDevice->Release(); };
if (pDeviceContext) { pDeviceContext->Release(); };
// Cubo
if (pBuffer_Cubo) { pBuffer_Cubo->Release(); };
if (pTexture2d_Cubo) { pTexture2d_Cubo->Release(); };
if (pResource_Cubo) { pResource_Cubo->Release(); };
if (pShaderResourceView_Cubo) { pShaderResourceView_Cubo->Release(); };
if (pRenderTargetView_Cubo) { pRenderTargetView_Cubo->Release(); };
if (pDepthStencilView_Cubo) { pDepthStencilView_Cubo->Release(); };
if (pSamplerState_Cubo) { pSamplerState_Cubo->Release(); };
if (pPixelShader) { pPixelShader->Release(); };
if (pVertexShader) { pVertexShader->Release(); };
if (pPlayoutDesc) { pPlayoutDesc->Release(); };
CoUninitialize();
return static_cast<int>(msg.wParam);
}