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.


noatom

Member Since 23 Jun 2012
Offline Last Active Nov 16 2014 06:28 PM

#5164175 How is this a pass by value?!

Posted by noatom on 01 July 2014 - 06:20 PM

Triple-facepalm-picard-812.jpg

 

 

I can't believe I didn't notice this:

 

I failed so hard because I was thinking about objects. You know, you have an object, and 2 pointers, a pointer points to it, and you make the second pointer point to it too, and no matter which pointer changes something about the object(using the dereference op, which is not used here, another triple facepalm for me), the other pointer will obviously see the change too.

 

Here, the situation was more like: the 2 pointers point to the same object, but later one of them is made to point to another different object...

void set(char const *&value)

There you took a reference to a pointer, and of course doing any change inside the function is actually made to the pointer outside the function.

 

 

 

You could've in a way, modify the outside char array if you could use the dereference operator, but since the array is constant(because its a literal), there is no way in which you can change the array.(ONLY if you were to dynamicly allocate it, you could freely change the array) and of course, not take a pointer to a constant value as an argument.

 

I explained it so if anyone will ever have the same problem as me, will see things the clear way.(MASSIVE HINT: Look for the GODDAMN dereference operator damn it!)

 

I'm literally cringing in shame when I think about this....oh god....

 

Thanks Brother Bob smile.png




#5135112 Using the same message processor but closing only 1 window

Posted by noatom on 27 February 2014 - 12:07 PM

Because I didn't know about EndDialog untill now,so thanks sleep.png




#5133864 Function call is jumped!

Posted by noatom on 23 February 2014 - 09:01 AM

Heh stop bashing your heads with this, I just disabled the optimizations in Visual Studio and it worked. I'm not really sure what kind of optimizations VS does if it excluded a function call like that but... that's it.




#5133796 Render directx in only a portion of a window

Posted by noatom on 23 February 2014 - 03:59 AM

Yea apparently using a viewport won't work since the backbuffer will still be created by default to fill the entire window. You simply cannot specify a custom buffer size. So,by using a viewport you will have all the space that is nonrendered black, and if you decide to put buttons or other controls in that space, there will be problems with rendering.

 

The only solution is to actually render in a control like a tab.




#5130371 Concatenating indices for meshes

Posted by noatom on 10 February 2014 - 02:19 PM

I'm basically trying to get all the data from all the meshes and put them into a single buffer(a buffer for vertices,one for indices). The models are of TriangleList type.

 

Here's how I'm currently doing it:

vector<unsigned long> finall_indices;
	unsigned long indices_before_adding = 0;
	for (long long i = 0; i < meshes.size(); i++){
		for (long long s = 0; s < meshes.at(i)->index_queue.size(); s++){
			finall_indices.push_back(meshes.at(i)->index_queue.at(s)+ indices_before_adding);
		}
		indices_before_adding += meshes.at(i)->index_queue.size();
	}

However,there are some problems,like missing quads. The indices are fine,because I tested them when I did not put all the mesh data together.

 

What am I doing wrong?

 

 

 

Answer:

 

To indices_before_adding should be added the nr of vertices in the last mesh,every time a new mesh's indices are added to the finall_indices mesh.




#5129823 Physics for a game

Posted by noatom on 08 February 2014 - 07:36 AM

Right now I have the basic velocity and gravity,and all is good. The problem is,when the player jumps and goes forward,the falling speed(and just the way the player falls is not that realistic).

 

If I increase the gravity,the player will come back to earth too fast,making it more unrealistic. Does anybody know some kind of guide for handling this type of stuff?




#5128401 c++11 move constructor question

Posted by noatom on 03 February 2014 - 06:25 AM

Suppose I have the following:

 

class Test {};

 

Test a;

vector<Test> v;

v.push_back(std::move(a));

 

Basically,now a has been moved to the vector(so it is a part of the vector now),but,what happens if I try to access the original a?(not the one that is in the vector now?)




#5128029 My singleton class is not so singleton

Posted by noatom on 01 February 2014 - 03:36 PM

Yes,that was the problem. I don't usually define functions in headers...but this time I did,and look what happened!

 

Thanks a lot




#5127422 Should I add any Nvidia intro if I use PhysX?

Posted by noatom on 30 January 2014 - 04:00 AM

B. For Games, Demos, and Videos that incorporate the PHYSX SDK or portions thereof, the NVIDIA
logos must appear:

a. on the back cover of the instruction manual or similar placement in an electronic file for the purpose of acknowledgement/copyright/trademark notice;
b. on external packaging;
c. during opening marquee or credits with inclusion of “NVIDIA”;
d. must appear on title marketing feature list with a specific call-out of NVIDIA PHYSX Technology
e. on the credit screen; and
f. in the “About” or “Info” box menu items (or equivalent) of all Physics Games or Applications using any portion of the PHYSX SDK.

 

 

Ok,but don't they provide any links where I can download the material(the logos,etc)?




#5127394 Should I add any Nvidia intro if I use PhysX?

Posted by noatom on 30 January 2014 - 01:02 AM

So,I'm using PhysX,and I was wondering,do I have to add a Nvidia intro/logo/anything because I'm using it in my demos?




#5127182 Why doesn't screen tearing happen at 5 fps?

Posted by noatom on 29 January 2014 - 06:15 AM

This is one of those stupid questions...but yeah,i couldn't get it out of my head so I had to ask.

 

Normally,screen tearing happens when there are more than 60 fps rendered,since the flipping is done before the monitor finishes rendering what is on the front buffer.

 

But,why doesn't it happen below 60 fps too? How is it that it's always synchronized,so it NEVER happens that a flip is done when the monitor is still rendering from the front buffer?




#5126556 WIN32 how to put an image on the desktop without a window?

Posted by noatom on 26 January 2014 - 12:48 PM

It is a window. While it is typical to include borders, a title bar, and other features it isn't required.

There are many articles like this that can probably fill in the pieces you don't know.

 thanks,that helped




#5126525 WIN32 how to put an image on the desktop without a window?

Posted by noatom on 26 January 2014 - 10:52 AM

Suppose my win32 app is minimized...how would should I go about displaying an image on the desktop? Something similar to the clock in this picture:

 

Widnows-8-Metro-Start-Widget.png




#5123094 Pointer to pointer question

Posted by noatom on 12 January 2014 - 12:16 PM

you got it wrong,when I had IDirect3DIndexBuffer9 **pp,i simply passed it as pp,not &pp.




#5118395 Can someone make this VS 2010?

Posted by noatom on 20 December 2013 - 11:47 AM

so why do you think i asked in the first post for help...? maybe because i got stuck in the hurdles of mingw? Then i had 2 posts suggesting me to use visual studio,which I did...






PARTNERS