|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Passing IDirect3DTexture9* to a function
Hi every body...
I've got a problem with references(type &var) and pointers(type *var).look at the following sample code : /* (1) */ void CreateTexture1( IDirect3DTexture9* pTexture ) { // some code that create texture from file }; /* (2) */ void CreateTexture2( IDirect3DTexture9*& pTexture ) { // some code that create texture from file }; void mainFunction() { . . . IDirect3DTexture9* pTexture = NULL ; CreateTexture1( pTexture ); CreateTexture2( pTexture ); . . . }; I'm going to use passed argument as an output. Both CreateTexture1 & CreateTexture2 using exactly the same code , but different type of argument passings. "CreateTexture1" can not alter pTexture but "CreateTexture2" can. why? I passed the argument with it's pointer so it must be changed? but it didn't on CreateTexture1! I don't have such a problem with types DWORD,UINT ,... but I have this with IDirect3DTexture9 . Can you tell me why or redirect me to an article about it on the web? Thank you. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Game Development > Passing IDirect3DTexture9* to a function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|