Ah, good man.
As for the operator, no unfortunately not. There must be an explicit lvalue and rvalue. So operator+ would have to be defined for point and vector both.
As that is a binary operator you also have the choice of taking the definition outside of the class.
Search found 387 matches
- Mon Mar 29, 2010 7:58 pm
- Forum: Programming Discussion
- Topic: c++ specific (operator overloading) vector+point
- Replies: 10
- Views: 663
- Mon Mar 29, 2010 6:56 pm
- Forum: Programming Discussion
- Topic: c++ specific (operator overloading) vector+point
- Replies: 10
- Views: 663
Re: c++ specific (operator overloading) vector+point
I vehemently disagree. We actually had a fairly lengthy discussion about this in another post. There was a post that I'd made a long time ago where I discussed that you CAN VIEW......a point as a vector offset from "some origin" ....wherever that is. Apparently some light bulbs ticked on a...
- Mon Mar 29, 2010 6:17 pm
- Forum: General/Off-Topic
- Topic: How does your workspace look?
- Replies: 35
- Views: 5321
Re: How does your workspace look?
So what's the OTHER several hundred pages of that book filled with? Creme-filling?
- Mon Mar 29, 2010 6:07 pm
- Forum: General/Off-Topic
- Topic: How does your workspace look?
- Replies: 35
- Views: 5321
Re: How does your workspace look?
Some concepts are timeless.
Maybe your algorithm book needs a watch :D
Maybe your algorithm book needs a watch :D
- Mon Mar 29, 2010 6:01 pm
- Forum: General/Off-Topic
- Topic: How does your workspace look?
- Replies: 35
- Views: 5321
Re: How does your workspace look?
I've seen your code, I *KNOW* you didn't read "A practical introduction to Data Structures and Algorithm Analysis"
![Wink ;)](./images/smilies/icon_wink.gif)
![Wink ;)](./images/smilies/icon_wink.gif)
- Mon Mar 29, 2010 5:27 pm
- Forum: General/Off-Topic
- Topic: How does your workspace look?
- Replies: 35
- Views: 5321
Re: How does your workspace look?
I like how your textbooks serve their highest purpose as a prop for your plywood table.
....fkn redneck.
....fkn redneck.
- Mon Mar 29, 2010 5:21 pm
- Forum: General/Off-Topic
- Topic: How does your workspace look?
- Replies: 35
- Views: 5321
Re: How does your workspace look?
....and after a weekend of paint and Ikea.
![Image](http://i119.photobucket.com/albums/o121/qphalcyon/1-3.jpg)
![Image](http://i119.photobucket.com/albums/o121/qphalcyon/1-3.jpg)
- Mon Mar 29, 2010 5:09 pm
- Forum: Programming Discussion
- Topic: What is wrong with this Linked List destructor?
- Replies: 21
- Views: 1541
Re: What is wrong with this Linked List destructor?
Heh... Consider what happens. If no appropriate copy constructor is supplied, the runtime will supply one for you. Your linked list contains a pointer to a type. When you call the insertion operator (makes a copy) it will use the default method. This method simply copies the VALUE of the pointer (eg...
- Mon Mar 29, 2010 5:04 pm
- Forum: Programming Discussion
- Topic: What is wrong with this Linked List destructor?
- Replies: 21
- Views: 1541
Re: What is wrong with this Linked List destructor?
You didn't supply a copy constructor for the linked list did you?
- Sun Mar 28, 2010 2:33 pm
- Forum: Game Development
- Topic: 3D Graphics Engine Progress
- Replies: 294
- Views: 116371
Re: [GroundUpEngine] 3D Engine Progress
No, you had it right. "uniform" variables in GLSL are indeed read-only (constant). They are passed to constant registers on the logic unit (You can define them at compile time (in the shader) or link time (from the caller). "varying" parameters in GLSL are passed by "registe...
- Sat Mar 27, 2010 1:43 pm
- Forum: General/Off-Topic
- Topic: How does your workspace look?
- Replies: 35
- Views: 5321
- Fri Mar 26, 2010 6:15 pm
- Forum: Programming Discussion
- Topic: 4 bytes can pack a whole lot.
- Replies: 9
- Views: 772
Re: 4 bytes can pack a whole lot.
There's a TON of application there where it comes to encryption, run time encoding, file compression, texture compression, network compression, your mom compression. The important thing is to not view data types so much as concrete types that have ONE application, but rather just as a bitfield of an...
- Fri Mar 26, 2010 2:33 pm
- Forum: Programming Discussion
- Topic: [SOLVED][SDL] Rotating a specific area of a surface
- Replies: 22
- Views: 1854
Re: [SDL] Rotating a specific area of a surface
You might define something like so: struct RGBA8_PIX { char r, g, b, a; // 32 bpp in RGBA (DirectX style) ordering }; struct RGB8_PIX { char r, g, b; // 24 bpp in RGB (DirectX style) ordering }; template <class T> static void swap_pix(T& l, T& r) { T tmp = l; l = r; t = tmp; } // Might check...
- Thu Mar 25, 2010 4:11 pm
- Forum: Programming Discussion
- Topic: [SOLVED][SDL] Rotating a specific area of a surface
- Replies: 22
- Views: 1854
Re: [SDL] Rotating a specific area of a surface
The API (whichever you're using...SDL, LibPNG or what have you) should be able to retrieve all that information for you. Either way, if you load an image you MUST know those things. If the memory lock maps to a void* or char* then you can just cast it to a BGRA8_PIX type or what have you and you'd b...
- Thu Mar 25, 2010 2:47 pm
- Forum: Programming Discussion
- Topic: [SOLVED][SDL] Rotating a specific area of a surface
- Replies: 22
- Views: 1854
Re: [SDL] Rotating a specific area of a surface
Now yer thinkin. Absolutely you can. Just like a regular array, you can offset by width and height. The only difference in an image is that you have to offset by the bytes per pixel as well. So when you map the tilesheet from memory, you can read in pixel by pixel with whatever looping structure you...