Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 25th, 2007, 09:35 AM
Mehdi_H Mehdi_H is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 31 Mehdi_H New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 10 h 36 m 43 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > Passing IDirect3DTexture9* to a function

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap