Irrlicht data types

Discussion about everything. New games, 3d math, development tips...
Post Reply
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Irrlicht data types

Post by pippy3 »

Irrlicht data types are so handy. I can't imagine programming c++ without them.

s = singed, u = unsigned, d = double, f float and c = char. Then add byte amount.

I wonder if other libraries include them. In fact, I wonder if irrlicht can submit these data types to IEEE to get them into a future iteration of a c++ standard.

I wouldn't be surprised if they're in boost libraries or simliar.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Irrlicht data types

Post by randomMesh »

"Whoops..."
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

that's not the same thing

i think I'll get bored of writing

uint32_t
instead of
u32.


I used to include <irrTypes.h> in all my programs. Also in programs that don't uses irrlicht.

also the float

f32 is usefull. is hard mistyping it.

while when you write"float"

sometimes happens that you write "falot" "flaot" ecc.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Guys? Get a decent IDE that corrects typos like "flaot" for you...
Or one with a good auto completion so you only have to type "fl" ;)
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

REDDemon wrote:i think I'll get bored of writing

uint32_t
instead of
u32.
Well, since the using namespace directive is evil, it would be

Code: Select all

irr::u32
So typing uint32_t would probably be faster.
"Whoops..."
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

I have my own collection of headers with typedefs and math functions and what not I use throughout a lot of my personal projects, mostly based upon irrlicht's

It's really nice to have a set of libraries of your own which you can keep independent of the project you're doing
fmx

Post by fmx »

I use the irrlicht types in my projects too, even on iOS where I dont use irrlicht; the types are extremely handy and I've become accustomed to using them everywhere 8)
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

randomMesh wrote:
REDDemon wrote:i think I'll get bored of writing

uint32_t
instead of
u32.
Well, since the using namespace directive is evil, it would be

Code: Select all

irr::u32
So typing uint32_t would probably be faster.
But writing using irr::u32; would save typing the long run. Though I simply just use namespace irr; in all my headers anyway. The "probably not" is simply a coding suggestion.

While I've always hated namespaces (PHP; et tu?) they do make things nice and quantified when dealing with multiple c++ libraries. The is one aspect where C++ is really starting to show its age.

Python not surprisingly does it perfectly by treating directories like namespaces. The from x import y is fantastic.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

I've sometimes just kept irrlicht included in my console programs for the handy data types. Makes the .exe bigger and has to have the .dll, but makes my job easier I think.
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

Lonesome Ducky wrote:I've sometimes just kept irrlicht included in my console programs for the handy data types. Makes the .exe bigger and has to have the .dll, but makes my job easier I think.
That's like carrying a car door while wandering in the desert so you can open the window to get some fresh air.

Seriously, the 'handy' datatypes are already there. All you need is to include stdint.h. If you want u32 rather than uint32_t, use a typedef. There is no point in including Irrlicht.
"Whoops..."
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

randomMesh wrote: That's like carrying a car door while wandering in the desert so you can open the window to get some fresh air.
Sounds like a good idea to me!

But seriously, I'm not talking about just data types, I also like the vector classes, matrices, etc. If I only wanted the data types, I'd use a typedef. Sorry if my last post was misleading.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Lonesome Ducky wrote:I've sometimes just kept irrlicht included in my console programs for the handy data types. Makes the .exe bigger and has to have the .dll, but makes my job easier I think.
Wouldn't it be easier to just include irrTypes.h, or does that also require to build lib?
Working on game: Marrbles (Currently stopped).
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

serengeor wrote:
Lonesome Ducky wrote:I've sometimes just kept irrlicht included in my console programs for the handy data types. Makes the .exe bigger and has to have the .dll, but makes my job easier I think.
Wouldn't it be easier to just include irrTypes.h, or does that also require to build lib?
Haha, I was thinking this.

Just remove the namespace and you've got a perfect header.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Well, I have a blank console project that includes irrlicht by default. Why would I download a new library, learn how to use it, or recompile irrlicht, when I don't have to? It's easier not to change anything. I mean if I actually planned on releasing it, I'd of course pick something more compact. But I never release it (I use it as practice), so there's no real point in changing anything. Thanks for the concern though :lol:
Post Reply