Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Jul 2011
Offline Last Active Yesterday, 02:38 PM

Posts I've Made

In Topic: [c++] ENet

23 October 2016 - 09:47 PM

ENet is heavily lightweight compared to Raknet, if both are stable and mature, does that make him a better choice ?

In Topic: Windows.h Issues Since Visual Studio 2015 Update 3

31 July 2016 - 10:37 AM

OH ! Apparently it's because one third party set _WIN32_WINNT to 0x0500 and set WIN32_LEAN_AND_MEAN

I modified the header of this third party and now all compile ok without additional include or needed to set one macro on compilation

In Topic: how to use ambient light

29 June 2016 - 08:57 PM

You was on the good road, never search complicated :

finalColor = (textureColor * ambientColor) + (textureColor * diffuseLightColor);

In other words, ambient is just a colorized diffuse texture added on the lighting or set as a start if multiple lights are added in the final color.

In Topic: Read one text line without limit correctly

05 February 2016 - 05:16 AM

data is of a type CString. While I'm not familiar with the type it is reasonable to assume it will do its own copy.

Yes, all is handled by the custom class.


This is a nonstandard function, but you didn't say what platform you're on, so...

Cross-Platform is needed, but I didn't think a platform test was needed for this specific case.

In Topic: Read one text line without limit correctly

04 February 2016 - 09:35 PM

I missed to mention it's to read from a FILE pointer and output into a custom string class variable, here the actual code :

bool CFile::ReadLine( CString& Data, const UInt32 MaxLineLength )
  // Allocate the buffer used to read the line.
  char* Buffer = new char[ MaxLineLength ];

  // Read the line into the buffer.
  if( fgets( Buffer, MaxLineLength, m_File ) != nullptr )
    Data = Buffer;
    delete[] Buffer;
    return true;
    delete[] Buffer;
    return false;