unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > Programming > Direct3D

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2006, 07:24 AM
zero_tolerance zero_tolerance is offline
Senior Member
 
Join Date: Dec 2006
Posts: 289
Default Displaying the screen resolution

By RoverTurbo

How to display the screen resolution in d3d.

Code:
D3DVIEWPORT9 oViewport;
char cResolution[101];

HRESULT APIENTRY IDirect3DDevice9::BeginScene()
{

  Device->GetViewport(&oViewport);

  return Device->BeginScene();

}


HRESULT APIENTRY IDirect3DDevice9::EndScene()
{

  sprintf(cResolution, "[ %d x %d ]", oViewport.Width, oViewport.Height);

  return Device->EndScene();

}
Printing the cResolution variable will give you the resolution in the format of [ 800 x 600 ]

Credits: Directx documentation and Directx Community.
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
displaying, resolution, screen

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:55 AM.