MSVC2010EX - DirectX9 - Disable 64 bits

Started by
3 comments, last by mobjr 12 years, 9 months ago
I' m Sorry. I don't speak English very well.

I have Visual Studio 2010, I understand, my MSVC2010 try to compile with an option 64 bits but I have 32 Bit.
I would like to disable this option but I can`t find. I have WinXP 32 Bits.

I found something about 64 bits but I can' t find this option "/Wp64" in my MSVC2010:
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release

I found an error:


typedef _W64 unsigned int size_t;


------ Build started: Project: dx3dfullscreen, Configuration: Debug Win32 ------
Build started 4/7/2011 09:01:37.
InitializeBuildStatus:
Touching "Debug\dx3dfullscreen.unsuccessfulbuild".
ClCompile:
dx3dfullscreen.cpp
c:\program files\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29): error C2144: syntax error : '__w64 unsigned int' should be preceded by ';'
c:\program files\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Build FAILED.

Time Elapsed 00:00:01.50
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Advertisement
The error is on first line in your "dx3dfullscreen.cpp" file.
Remove the "g" character there.
Thanks. I removed. Unbelievable I found another problem. there is Screenshot.
I'm not sure but I believe this error is between the chair and Computer(Me).
I wrote this because I thought I found an error after to put this post but I was wrong

[size="5"]Please ignore this topic.
Most likely d3ddev variable is NULL. Try debugging your code to see where it gets initialized.

And you should stop posting screenshot of problems. Copy&paste error text and code snippet.

Most likely d3ddev variable is NULL. Try debugging your code to see where it gets initialized.

And you should stop posting screenshot of problems. Copy&paste error text and code snippet.


Thank you. OK, there is no problem, as you wish:




#include <windows.h>
#include <windowsx.h>

#include <d3d9.h>

#pragma comment (lib,"d3d9.lib")


#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600

LPDIRECT3D9 d3d;
LPDIRECT3DDEVICE9 d3ddev;



void initD3D(HWND dhwnd);
void render_frame(void);
void cleanD3D(void);


LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uwmsg,
WPARAM wpam,
LPARAM lpam);

int WINAPI WinMain(
HINSTANCE his,
HINSTANCE hps,
LPSTR lpCmdLine,
int nShow){



HWND hwnd;
WNDCLASSEX wc;


ZeroMemory(&wc,sizeof(WNDCLASSEX));



wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.hInstance = his;
wc.hCursor = LoadCursor(NULL,IDC_ARROW);
wc.lpszClassName = "WindowClass";


RegisterClassEx(&wc);


hwnd = CreateWindowEx(
NULL,
"WindowClass",
"MinGW C/C++ - Win32 Application",
WS_EX_TOPMOST|WS_POPUP,
0,
0,
SCREEN_WIDTH,
SCREEN_HEIGHT,
NULL,
NULL,
his,
NULL);

ShowWindow(hwnd,nShow);

initD3D(hwnd);

MSG msg;

while(TRUE){
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if(msg.message == WM_QUIT){
break;
}
render_frame();
}
cleanD3D();

}


void initD3D(HWND dhwnd){

d3d = Direct3DCreate9(D3D_SDK_VERSION);

D3DPRESENT_PARAMETERS d3dpp;

ZeroMemory(&d3dpp,sizeof(d3dpp));

d3dpp.Windowed = FALSE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = dhwnd;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferWidth = SCREEN_WIDTH;
d3dpp.BackBufferHeight = SCREEN_HEIGHT;

d3d->CreateDevice(
D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
dhwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&d3ddev);
}

void render_frame(void){

d3ddev->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0,40,100),1.0f,0);
d3ddev->BeginScene();

d3ddev->EndScene();
d3ddev->Present(NULL,NULL,NULL,NULL);

}

void cleanD3D(void){
d3ddev->Release();
d3d->Release();
}


LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uwmsg,
WPARAM wpam,
LPARAM lpam){

switch(uwmsg){
case WM_DESTROY:
PostQuitMessage(0);
return 0;
break;
}
return DefWindowProc(hwnd,uwmsg,wpam,lpam);
}









------ Rebuild All started: Project: dx3dfullscreen, Configuration: Debug Win32 ------
Build started 4/7/2011 13:10:05.
_PrepareForClean:
Deleting file "Debug\dx3dfullscreen.lastbuildstate".
InitializeBuildStatus:
Creating "Debug\dx3dfullscreen.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
dx3dfullscreen.cpp
Link:
dx3dfullscreen.vcxproj -> C:\Documents and Settings\miltonjr\My Documents\Visual Studio 2010\Projects\dx3dfullscreen\Debug\dx3dfullscreen.exe
FinalizeBuildStatus:
Deleting file "Debug\dx3dfullscreen.unsuccessfulbuild".
Touching "Debug\dx3dfullscreen.lastbuildstate".

Build succeeded.

Time Elapsed 00:00:04.91
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

This topic is closed to new replies.

Advertisement