Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Daivuk

Member Since 26 Mar 2002
Offline Last Active Oct 30 2014 02:29 PM

Posts I've Made

In Topic: (Super) Smart Pointer

11 July 2014 - 10:16 AM

We call this a "Weak Reference".

I don't have examples at hand, but that's the term you want to search for smile.png

 

Edit: What BitMaster said. std::weak_ptr


In Topic: Equivalent of glHint(GL_PERSPECTIVE_CORRECTION_HINT , GL_NICEST);

21 May 2014 - 03:24 PM

 

If the shape is 2D, and you've manually moved the top two verts closer together, you'll get the image in the middle. D3D/GL cannot magically fix this for you.


Exactly, this is the purpose for the original question. It seems that this GL Hint does 'magically' fix it.

 

I highly doubt OpenGL can fix this also.

 

The hint is called "PERSPECTIVE". Which means it doesn't work for 2D. It needs the z (depth) value to calculate this correctly. In 2D no such things. The GPU can not know the context of that triangle in a 2d environement. And doesn't understand it is a quad at low level.

 

If all 4 points have the same z value in your 2D render (let say, 0), and GL gives you the right picture, then the driver or opengl is wrong. What about I want to skew a rectangle on the side?


In Topic: A good engine for GameDev...

20 May 2014 - 04:17 PM

If you don't want to do a lot of coding, like you say. And you already know C#. Then Unity3D is your choice.

 

XNA is certainly enough to make interesting games. Tons of games on Steam use it. And I did pretty amazing stuff with it.

 

I'm personally not a big fan of "Engines" per say. I prefer having a set of libraries that do certain jobs for you: Load images, draw fonts, do inputs, etc. Like SDL or SFML.

Then you build the "game engine" around it.


In Topic: Questions for all programmers.

16 May 2014 - 01:01 PM

1) What was the first programming language you studied?

QBasic in DOS

 

2) Did you have any Computer Science background before your first language (ie: boolean algebra, memory organisation, algorithms)?

No

 

3) The first language you studied was it self-taught, formal instruction, or both?

Self-taught

 

4) Was the Computer-Science background self-taught, formal instruction, or both?

Self-taught

 

5) When you started to study Computer Science did it help your understanding of the language you first learned?

I never studied Computer Science. But my game programming courses didn't help much as I had already learned everything by myself. But my background helped me get good grades.

 

6) What kind of environment did you first program in (ie: the IDE or text editor, and the OS)?

QBasic had it's own text editor in DOS


In Topic: Why are static variables bad?

04 September 2013 - 07:32 AM

As a concrete example of why they are bad:

 

I am using Cocos2dX for a project. And we had to send network call. Great, cocosx provides a client HTTP built on top of Curl.

It's a singleton class (Which means a global var basically) with most of its variable static or globally declared in the CPP. It didn't cause problem at first. Everything is queued when I make multiple call. Ok, perfect.

 

But then, we started to want to send some calls simultaneously. LIke uploading a file in the background, but continuing navigating in the app.

 

But we can't, because there is only 1 instance of the HTTP client! And we can't instantiate another one, because everything is static in it. And they even had global vars in the CPP!! A design that sounded good at first ended up a nightmare. I was able to remove the static vars and globals. I can now create multiple instance of the class.

 

It's a good example I believe. Also if your game end up supporting multiplayer or split-screen. If all you have are static, you will be in hell. (Been there also)


PARTNERS