Screenshot of the Day #100: Exclusive Editor Screenshots

Originally posted by anarres
Ooh, I want a graphics card that supports two monitors too!!
Originally posted by Isak

I want two monitors .... :cry:

I use a Laptop, so when I plug in my monitor I get 2 screens ;)

VERY useful, especially with Civ3 that works *VERY* well with 2 screens.

Now we know why :p
(Ugly Coloring scheeme MIKE ;) the Green on Red I mean... the hardest combo to read I might add)
 
Originally posted by Grey Fox



I use a Laptop, so when I plug in my monitor I get 2 screens ;)

VERY useful, especially with Civ3 that works *VERY* well with 2 screens.

Now we know why :p
(Ugly Coloring scheeme MIKE ;) the Green on Red I mean... the hardest combo to read I might add)

How do you do that? If I plug a monitor into my laptop, only the plugged monitor shows.
Then again, never mind, since two monitors would hurt my head :crazyeye:
 
Isn't it a coincidence that the youngsters say that it's boring (fartin bob, china44) while others, 10-20 years older, find it interesting? I find it a bit boring too, for my 2 cents. ;)

I can tell you with two monitors it was hell to load it up - twice as long. :angry: Darn MSN. AOL would have been faster in loading this up, which pretty sad.

Interesting shots. C'mon, I have lots of good shots - I sent you five or so, Thunderfall? Today I'll send another one - one I like to call "Stack of Doom 2x" - really neat IMO.
 
Originally posted by Grey Fox

I use a Laptop, so when I plug in my monitor I get 2 screens ;)

VERY useful, especially with Civ3 that works *VERY* well with 2 screens.

Oh great... :rolleyes:

Now I want a laptop too.... :cry:

Originally posted by hbdragon88
Isn't it a coincidence that the youngsters say that it's boring (fartin bob, china44) while others, 10-20 years older, find it interesting? I find it a bit boring too, for my 2 cents.

Who told you my age.... :scan:

Well isn't it just a fact of life that teens giggle over farts, nudity and stacks of doom, while those a bit older laugh at everything cause we never know,... it might be our last chance.. ;)
 
Originally posted by hbdragon88
Isn't it a coincidence that the youngsters say that it's boring (fartin bob, china44) while others, 10-20 years older, find it interesting? I find it a bit boring too, for my 2 cents. ;)

Nope, because Im about your age and I find it very interesting. :)
 
I should have added a 'generally' to that. :hmm: Should I edit it right now? And Isak, I didn't even know about your age. Now that I look at your profile all it says is just "August 15"
 
Originally posted by hbdragon88
Now that I look at your profile all it says is just "August 15"
...which doesn't exclude the possibility that he's as young as a few months. :)
 
Heh, I'm old enough to want to hide my age anyway :)

But if you must know, the missing digits are: 73. :scan:
 
hmm....that code really should use the Resource Acquisition Is Initialization (RAII) idiom.

i.e. this code:

---

pbmpOldDst = dcDst.SelectObject( &m_bmpBitmap );
pbmpOldSrc = dcSrc.SelectObject( sprFrom.GetBitmap() );

bSuccess = dcDst.BitBlt( 0, 0, nWidth, nHeight, &dcSrc, nX, nY, SRCCOPY );

dcDst.SelectObject( pbmpOldDst );
dcSrc.SelectObject( pbmpOldSrc );

---

is brittle and error prone. What if the bits in the middle threw an exception? Then the bitmaps wouldn't get reselected properly? Likewise, what if the code was modified and someone forgot to reselect the bitmaps properly? It's much safer and cleaner to use the RAII idiom. All you have to do is define a simple helper class template:

template<typename T>
class object_selecter
{
CDC& cdc_;
T* obj_;
public:
object_selecter(CDC& cdc, T* obj) : cdc_(cdc), obj_(obj) {}
~object_selecter() { cdc_.SelectObject(obj_); }
};

and then you can rewrite the above code to:

const object_selecter<CBitmap> dst_releaser( dcDst,dcDst.SelectObject( &m_bmpBitmap ) );
const object_selecter<CBitmap> src_releaser( dcSrc, dcSrc.SelectObject( sprFrom.GetBitmap() ) );

bSuccess = dcDst.BitBlt( 0, 0, nWidth, nHeight, &dcSrc, nX, nY, SRCCOPY );

//the bitmaps will automatically be reselected here

This way of doing it is much cleaner, more elegant, and safer. You can make it even more generic than that.

C++ is a great language, but to get the full benefit out of it, you really do have to learn to use it properly. People whine about how it requires explicit memory management, but then neglect to use powerful techniques such as RAII to help manage their memory.

-Sirp.
 
Top Bottom