directX pointers

Started by
2 comments, last by LowRad 17 years, 11 months ago
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
Advertisement
There is nothing special about them (as far as C++ is concerned). What do you want to do?
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
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?
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: 0012FED4Value of anInt: 686868Address of anIntPtr: 0012FEC8Value of anIntPtr: 0012FED4Value referenced by anIntPtr: 686868


Regards,
Jonathan

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

This topic is closed to new replies.

Advertisement