Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualConny14156

Posted 25 December 2012 - 09:50 PM

Hi, This maybe is a stupid question but, I have a function like this Object::InitBuffer(ID3D11Device* D3d11Device) And I need to pass the D3d11Device, But when I do it like Object Test; Test.InitBuffer(D3d11Device); "nothing" happend, more like I see nothing >.<. I think it has something to do with that am just passing "value" and not the "whole" "object" so my program sets the setting onto another D3d11Device. But when I tried something like Test.InitBuffer(*D3d11Device); or Test.InitBuffer(&D3d11Device); I get errors :/ So my simple question is. Is the first passing parameter the correct way to do it? if not is there another way I should do it? if so what would that be? if the first parameter is correct than its something wrong with my function but I tried to do it "normal" (By having the function inside the same cpp file) than It worked as it suppose to be.


#1Conny14156

Posted 25 December 2012 - 07:43 PM

Hi,

This maybe is a stupid question but,

I have a function like this

 

Object::InitBuffer(ID3D11Device* D3d11Device)

 

And I need to pass the D3d11Device,

But when I do it like

 

Object Test;

Test.InitBuffer(D3d11Device);

"nothing" happend, more like I see nothing >.<.

I think it has something to do with that am just passing "value" and not the "whole" "object" so my program sets the setting onto another D3d11Device. But when I tried something like

Test.InitBuffer(*D3d11Device);

or

Test.InitBuffer(&D3d11Device);

I get errors :/

 

So my simple question is.

 

Is the first passing parameter the correct way to do it?

if not is there another way I should do it?

if so what would that be?

 

if the first parameter is correct than its something wrong with my function but I tried to do it "normal"

 

(By having the function inside the same cpp file)

than It worked as it suppose to be.


PARTNERS