Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Endurion

Member Since 21 Feb 2002
Offline Last Active Today, 10:17 AM
*****

#4912210 sprintf and sprintf_s

Posted by Endurion on 12 February 2012 - 01:04 AM

Just to clarify: Just because send has a char* argument, doesn't mean you have to provide readable text.

You can directly send binary data as well.


Besides sending that thing over the net, the even worse performance problem will be formatting the floats to a string and back on the server. And now that string streams are introduced it's even got worse.

Since your floats are in a continuous buffer anyway, just send bufferData.


#4903141 Win32 CHange Window Position and Resizing Window?

Posted by Endurion on 16 January 2012 - 12:03 AM

SetWindowPos does what you're looking for. Using the flags SWP_NOMOVE or SWP_NOSIZE you can control which parts of the call are actually done.


#4882457 Windows Dialog Box Problem

Posted by Endurion on 10 November 2011 - 01:16 AM

I think so, I'm not on Facebook anyway :)


#4882010 Windows Dialog Box Problem

Posted by Endurion on 09 November 2011 - 12:37 AM

Your AddOrder proc is always returning true. You should only return true, if you fully(!) handled a message, and false for everything else.

If you return true, Windows thinks the message is fully handled and doesn't do any default behaviour.


#4878212 In german, what do wären, hätten and würden mean?

Posted by Endurion on 29 October 2011 - 05:38 AM

wären = (they) would have been
hätten = (they) would have had
würden = (they) would (do)

All "would"s as if they could if they wanted.

Samples:
Sie wären gerne einkaufen gegangen = They would have liked to go shopping.     (possible in the past)
Sie hätten gerne eingekauft = They would have liked to shop        (possible in the past)
Sie würden gerne einkaufen = They would like to shop           (possible in the future)

My translations to English are maybe not exact.


#4868496 D3DXCreateTextureFromFile == D3D_OK but crashing.

Posted by Endurion on 02 October 2011 - 11:49 PM

As mhagain pointed out. That:



IDirect3DDevice9* device = *(IDirect3DDevice9**)0xC97C28; // DirectX Device


will of course crash once you access the device; unless you're very very lucky to get the same pointer.

I assume you create the device in your main app and want to access it in your DLL? If so, you need to pass the app's device into the DLL, not rely on some random pointer value you once received.


#4867888 Something you never knew about Steve Jobs

Posted by Endurion on 01 October 2011 - 12:29 AM

iDontCare


#4853086 How to compile my game project?

Posted by Endurion on 23 August 2011 - 11:24 PM

Never ever give away the Debug folder. Debug usually consists of having specialized debug libraries included, which are simply not available on other peoples computer. If you pass on your game, always pass the Release build.

Depending on your dependencies you can get away with providing the binary and data files in a simple archive. You do have to make sure that you put the required dependencies in there too (in your case, the Tao framework resides in a assembly .dll).

If you're using Visual Studio there should be a option "Publish Project". This will create an installer project and usually automatically includes the dependencies as well.


#4852658 SEGFAULT Occuring Outside GDB, but not inside.

Posted by Endurion on 23 August 2011 - 12:02 AM

The erase part is correct, he uses the iterator returned by it.  Check if you don't put an Actor in several ObjectLists (ie. it subscribed to several events), as you seem to only remove the actor from the current ObectList. In those cases you'd have invalid pointers in the other lists.


#4848863 Is DirectSound deprecated?

Posted by Endurion on 13 August 2011 - 11:23 PM

DirectSound still works nicely in Vista and later, you just have to allow software instead of hardware accelleration. The proper way is to check for hardware first, if that fails, fall back to software calculation.


#4835412 The GDNet Birthday thread

Posted by Endurion on 14 July 2011 - 02:02 PM

Happy Birthday GD.net!



After all that time Flash still puts quite a big spike in the cpu meter ;)



And free rope for everyone!


#4831661 Newbie Bitmap Woes

Posted by Endurion on 06 July 2011 - 12:51 AM

Probably doesn't fix the problem, but you need to use the correct DC destroy functions:

For CreateCompatibleDC it's DeleteDC. For GetDC it's ReleaseDC.

Also, you do not have to create a new DC for every bitmap you want to blit. Think of a HDC as a device context (holds a bitmap, a brush, a pen, etc.). You can select a new bitmap in. Just make sure to finally select the first bitmap back in:

HDC backHDC = CreateCompatibleDC(hdc);
HBITMAP backbuff = CreateCompatibleBitmap(hdc, nclientWidth, nclientHeight);
HBITMAP hbmpOld = (HBITMAP)SelectObject(backHDC, backbuff);

// Draw the background
HDC hDisplayDC = CreateCompatibleDC(hdc);
HBITMAP hbmpItemOld = (HBITMAP)SelectObject( hDisplayDC , hbmpWorld );

if(!BitBlt(backHDC, 0, 0, nclientWidth, nclientHeight, hDisplayDC , 0, 0, SRCCOPY))
lastError = GetLastError();

// Draw the ball mask
SelectObject( hDisplayDC , redBall.GetCharacterMask() );

if(!BitBlt(backHDC, (int)redBall.Position.X, (int)redBall.Position.Y, redBall.GetCharacterInfo().bmWidth,
redBall.GetCharacterInfo().bmHeight, hDisplayDC, 0, 0, SRCAND))
lastError = GetLastError();

// Draw the ball
SelectObject( hDisplayDC , redBall.GetCharacter() );

if(!BitBlt(backHDC, (int)redBall.Position.X, (int)redBall.Position.Y, redBall.GetCharacterInfo().bmWidth,
redBall.GetCharacterInfo().bmHeight, hDisplayDC , 0, 0, SRCPAINT))
lastError = GetLastError();

SelectObject( hDisplayDC , hbmpItemOld );
DeleteDC( hDisplayDC  );

I've never used masks with GDI. You could try using TransparentBlt, which lets you use a color key.


#4823944 Getting the key name for a VK constant

Posted by Endurion on 15 June 2011 - 11:26 PM

This is probably what you're looking for: MSDN

However I find your statement that virtual keys shift around with keyboard layouts weird. That's the whole point of the virtual keys, they are defined constants and do NOT move around. The layout adjustment is done on a lower level, so a fixed string array should work fine.


#4823097 jokes

Posted by Endurion on 14 June 2011 - 01:58 AM

Nah, that would make this thread funny. Can't have that happen.


#4822622 Mini-Contest: ASCII Fishtank

Posted by Endurion on 12 June 2011 - 11:08 PM

Added growing algae and a bigger fish type. Yay me!




PARTNERS