Jump to content
  • Advertisement
Sign in to follow this  
jagguy

directX pointers

This topic is 4451 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In directX9, can you compare their specific pointers and structures to regular C++ code or do they work a little different to regular pointers/structures eg IDirect3D9*, D3DPRESENT_PARAMETERS, IDirect3DDevice9*etc

Share this post


Link to post
Share on other sites
Advertisement
some of the directX pointers you don't allocate memory , it just seems to work differently from regular pointers.

Also why allocate some variables as pointers in the first place as there seems no need for memory saving. Is it because they need to access the hardware directly?

Share this post


Link to post
Share on other sites
Quote:
Original post by jagguy
some of the directX pointers you don't allocate memory , it just seems to work differently from regular pointers.

Also why allocate some variables as pointers in the first place as there seems no need for memory saving. Is it because they need to access the hardware directly?


Hummm,

Red my last post on the last thread you started?

Quote:

A pointer doesnt contains the data, its only containning a reference (memory address) to the data.


Try to run this exemple, i hope it will help you understand pointers...


#include <iostream>
#include <conio.h>

using namespace std;

void main()
{
int anInt = 686868;
int *anIntPtr = &anInt;

cout << "Address of anInt: " << &anInt << endl;
cout << "Value of anInt: " << anInt << endl;
cout << "Address of anIntPtr: " << &anIntPtr << endl;
cout << "Value of anIntPtr: " << anIntPtr << endl;
cout << "Value referenced by anIntPtr: " << *anIntPtr << endl;

while(!kbhit());
}





It's output...

Address of anInt: 0012FED4
Value of anInt: 686868
Address of anIntPtr: 0012FEC8
Value of anIntPtr: 0012FED4
Value referenced by anIntPtr: 686868


Regards,
Jonathan

[Edited by - LowRad on May 9, 2006 4:28:23 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!