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.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 »
391
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.
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.
393
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.
394
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.
Window.PreserveOpenGLStates(true);
Window.PreserveOpenGLStates(true);
396
Issues Help Desk / Re: Stuff referencing each other.
« on: July 10, 2010, 09:31:08 pm »Doesn't work. At least, not on strict. I believe that the GCC has a flag for this sort of thing.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.
397
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.
398
Announcements / Re: Bugtracker trial
« on: July 06, 2010, 08:08:46 pm »
I could log in with my forums account... ?
399
Announcements / Re: Bugtracker trial
« on: July 06, 2010, 10:49:05 am »
The ticket icon looks like a bandage more than a ticket.
400
Announcements / Re: Happy Independence Day
« on: July 05, 2010, 09:37:37 pm »The politically correct word is native american or american indian, not indian.Political Correctness, not Trolling.The mass slaughter of Indians not being the least of them.Native Americans, not Indians. :|
401
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.
402
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. :|
403
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.
Example:
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.
Types could also be equal in complexity; it doesn't really matter. In that case, the second is casted to the first.
Example:
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.
405
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?
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?