Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - RetroX

Off-Topic / Re: I made a rectangle that MOVES!
« on: July 15, 2010, 08:37:17 PM »
Screw this tutorial; it's boring.

Can't someone just, like, make a reference?  I don't care how the commands work, but I want to know what they do without having to sift through fifty pages.

And I spoke too soon.

General ENIGMA / Re: Markdown
« on: July 15, 2010, 07:47:49 PM »
Forum wikitext, basically?

Off-Topic / Re: I made a rectangle that MOVES!
« on: July 15, 2010, 07:14:59 PM »
It's a nice start, I guess.  I probably should look more into GL, because I literally don't know anything about it.

Off-Topic / Re: Perfect low-level game framework
« on: July 10, 2010, 09:33:10 PM »
Your API is SFML.  It allows OpenGL to be directly used into the program, and drawables to be used as textures.


Off-Topic / Re: wtf
« on: July 10, 2010, 09:32:15 PM »
Why are you using subpixel smoothing

Issues Help Desk / Re: Stuff referencing each other.
« on: July 10, 2010, 09:31:08 PM »
Code: [Select]
class bar;
class foo { bar opposite(); }
class bar { foo opposite(); }

Disclaimer: I have not tested this. It might give an incomplete type error.
Doesn't work.  At least, not on strict.  I believe that the GCC has a flag for this sort of thing.

Announcements / Re: Bugtracker trial
« on: July 06, 2010, 08:23:20 PM »
That's because the username/password you used to register to the bugspray demo would've been exactly the same as your SMF one.
Well, when I tried to register, it said that my account already existed.  Probably already made one beforehand.

Announcements / Re: Bugtracker trial
« on: July 06, 2010, 08:08:46 PM »
I could log in with my forums account... ?

Announcements / Re: Bugtracker trial
« on: July 06, 2010, 10:49:05 AM »
The ticket icon looks like a bandage more than a ticket.

Announcements / Re: Happy Independence Day
« on: July 05, 2010, 09:37:37 PM »
The mass slaughter of Indians not being the least of them.
Native Americans, not Indians. :|
Political Correctness, not Trolling. :troll:
The politically correct word is native american or american indian, not indian.

Off-Topic / Re: Help coding something...
« on: July 05, 2010, 02:30:07 PM »
Yes, you can. It won't work because you can't assume that all types passed to a generic mixed() will have even operator+. If you could presume all available operators for both types, you'd be fine.
No, what I meant was how I could use a function to add the two doubles.  I would have two void*s, but that wouldn't do me much good.  I can't exactly cast them to double without using a template.

But I will.

And for operators and casts, it just shows an error if the function is NULL.  And when GCC 4.6 comes out, I'll change that to nullptr.

Announcements / Re: Happy Independence Day
« on: July 05, 2010, 02:26:18 PM »
The mass slaughter of Indians not being the least of them.
Native Americans, not Indians. :|

Off-Topic / Re: Help coding something...
« on: July 04, 2010, 11:28:08 AM »
And after reading that, I did think of a decent idea.  I'll just order the types by increasing complexity (bool and int are at the bottom, double and string are at the top), and then cast to the most complex type, and perform the operation.

Types could also be equal in complexity; it doesn't really matter.  In that case, the second is casted to the first.

mixed (stored as int) + mixed (stored as double)
double is more complex than int, and the int is casted to a double, then the operation is performed.

mixed + int returns mixed, which can be casted to int (this avoids loss of data when types like string are stored).
mixed + mixed returns mixed.

...and that wouldn't work because I can't just randomly pull a type definition out of nowhere.  Damn.

Announcements / Re: COmputers SUck
« on: July 02, 2010, 12:27:23 PM »

Off-Topic / Help coding something...
« on: July 02, 2010, 12:25:43 PM »
Remember that mixed type class that I was working on a long time ago?

Here's my scenario:
- The value for the variable is stored in a void pointer with an integer to decide which type is currently stored.  When the variable is typecasted, the value is casted the the proper type using a function (returning an error if it can't be).
- To cast types, a 2-dimensional array of "cast functions" is provided.  Each type that is supported is given an ID, and cast_functions[from][to] will provide the proper function to cast a void pointer from one type to another.  Invalid IDs, etc. return errors.

Here's the problem:
- For operators, you don't know what the type is, and thus, you can't exactly add two types together.  If you're adding mixed to a different type, you can use that type, but mixed and mixed?  It can't be done.

The only solution that I can think of for this is to create an array of functions for each operation, and that would result in a massive size; is there anyone with other suggestions for this?