• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

209 Neutral

About maxfire

  • Rank

Personal Information

  • Location
  1. OpenGL

    Thanks for the answers guys, my final solution was to use the glm RH ViewMatrix, then implement a projection matrix myself which serves up different z ranges based on a flag of OpenGL or DirectX.    Hodgman, I will give your scale and translate a go, seems like a better solution than making two different matrix's :)
  2. OpenGL

    Buckeye, you utter legend. After you said that I looked into glm its default is a RightHand projection and look at matrix. Once I use D3DXMatrixPerspectiveFovRH instead of D3DXMatrixLookAtLH it sprung to life :D.
  3. I'm creating a DirectX renderer for a project I previously made in OpenGL, reusing the glm library would be really useful.   Is it possible to convert the glm::lookAt matrix to work with DirectX, I have tried the following but the matrix created by DirectX Math Library is different D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 0.0f, 3.0f, 5.0f ), &D3DXVECTOR3( 0.0f, 0.0f, 0.0f ), &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) ); glm::mat4 gmatView = glm::lookAt( glm::vec3( 0.0f, 3.0f, 5.0f ), glm::vec3( 0.0f, 0.0f, 0.0f ), glm::vec3( 0.0f, 1.0f, 0.0f ) ); float* pt = glm::value_ptr( gmatView ); D3DXMATRIX matGLConvertView = D3DXMATRIX( pt ); Thanks
  4. I feel like a tool... it was that simple *dies inside*. Thank you so much
  5. I'm using the boost::iostream libraries to compress char* data however the implementations I have found involve iteration of vectors into string streams which is killing my performance.    Is there any way I can speed this process up? Here is the code from the example I am using  std::string Compress( char* pData, size_t size ) { std::vector<char> s; s.assign( pData, pData + size ); std::stringstream uncompressed, compressed; for ( std::vector<char>::iterator it = s.begin(); it != s.end(); it++ ) uncompressed << *it; io::filtering_streambuf<io::input> o; o.push( io::gzip_compressor() ); o.push( uncompressed ); io::copy( o, compressed ); return compressed.str(); } Thanks :)
  6. You are a legend my friend, worked like a charm
  7. Sorry for the newby question, hopefully its an easy question to answer I have tried hard to solve this :P   I'm trying to use the zlib compression filter with boost, however my build of boost does not include zlib (built using bjam with defaults). After going through the documentation I have tried to rebuild boost with zlib by the following steps.   1. Compiled Zlib using cmake and vs2013 2. Copied includes, libs, and dlls into boost folder (same folder as bjam) 3. Tried to run bjam with this command, bjam set ZLIB_BINARY = "zlib\bin\zlibd.dll" set ZLIB_INCLUDE = "\lib\include" set ZLIB_LIBPATH = "zlib\lib"   All I get its a list of module build errors. I'm thinking my command is a load of garbage however due to lack of Command Prompt experience that's what I came up with after reading a few pages online.   Example of error   C:/Users/Max/Downloads/boost_1_57_0/tools/build/src\build-system.jam:583: in loa d from module build-system   If anyone could link me to any information or give advice on the correct procedure that would be most welcome :D   Thanks :D 
  8. Sorry to post again but I am unable to find the answer to this anywhere.   In my c++ server application when I save my bitmap to a file using an ofstream in binary mode and then read that file in c# using File.ReadAllBytes which returns a BYTE array the bytes read in are different than when I send my data (unsigned char*) over a network from the server and read them as bytes on the c# client.    I know a byte in c# is an unsigned integer of 8 bits and an unsigned char is the same as uint_8 so why is the data different? What's the best approach to send my data to c# in the correct format? Am I missing some sort of encoding?   Heres some server code that shows the writing to memory void MyBitmap::WriteToFile( std::string sFileName ) { std::ofstream file; file.open( sFileName.c_str(), std::ios::binary ); //write headers file.write( ( char* ) ( &_header ), sizeof( _header ) ); file.write( ( char* ) ( &_info ), sizeof( _info ) ); //write pixel data file.write( reinterpret_cast<char*>( &_pPixelData[0] ), _sPixelDataSize ); //file.write( ( &_pPixelData[ 0 ] ), _sPixelDataSize ); file.close(); } MyBitmapMemoryBuffer* MyBitmap::WriteToMemoryChar() { size_t stHeaderSize = sizeof( BITMAPFILEHEADER ); size_t stInfoSize = sizeof( BITMAPINFOHEADER ); size_t stTotalImageSize = stHeaderSize + stInfoSize + _sPixelDataSize; MyBitmapMemoryBuffer* pMem = new MyBitmapMemoryBuffer(); pMem->pMemory = new char[ stTotalImageSize ]; pMem->size = stTotalImageSize; //write headers std::memcpy( &pMem->pMemory[ 0 ], ( char* ) ( &_header ), stHeaderSize ); std::memcpy( &pMem->pMemory[ stHeaderSize ], ( char* ) ( &_info ), stInfoSize ); //write pixels std::memcpy( &pMem->pMemory[ stHeaderSize + stInfoSize + 1 ], reinterpret_cast<char*>( &_pPixelData[ 0 ] ), _sPixelDataSize ); return pMem; } MyBitmapMemoryBuffer* MyBitmap::WriteToMemoryByte() { size_t stHeaderSize = sizeof( BITMAPFILEHEADER ); size_t stInfoSize = sizeof( BITMAPINFOHEADER ); size_t stTotalImageSize = stHeaderSize + stInfoSize + _sPixelDataSize; MyBitmapMemoryBuffer* pMem = new MyBitmapMemoryBuffer(); pMem->pMemoryByte = new BYTE[ stTotalImageSize ]; pMem->size = stTotalImageSize; //write headers std::memcpy( &pMem->pMemoryByte[ 0 ], ( BYTE* ) ( &_header ), stHeaderSize ); std::memcpy( &pMem->pMemoryByte[ stHeaderSize ], ( BYTE* ) ( &_info ), stInfoSize ); //write pixels std::memcpy( &pMem->pMemoryByte[ stHeaderSize + stInfoSize + 1 ], ( &_pPixelData[ 0 ] ), _sPixelDataSize ); return pMem; } Here's the c# code that reads the data protected void ChekcData() { int messageSize = 240054; int readSoFar = 0; byte[] msg = new byte[ messageSize ]; while ( readSoFar < messageSize ) { var read = stream.Read( msg, readSoFar, msg.Length - readSoFar ); readSoFar += read; if ( read == 0 ) break; // connection was broken } //compare byte[] tmp = File.ReadAllBytes( @"C:\Users\Max\Documents\Git Repositories\Advanced Programming\test.bmp" ); for ( int i = 0; i < tmp.Length; i++ ) { if ( tmp[ i ] != msg[ i ] ) { textBox.Text = "not same"; } } }
  9. *face smash* just kill me now xD. Thank you wintertime
  10. Sorry for yet another post, after 6 hours I'm pulling my hair out.. So everything seemed to work fine until I started looking at the bitmap file/buffer generated. The colour is different from what is actually rendered. I have searched high and low for Bitmap Headerfile examples but can't find any example that are hugely different from my implementation. Here is the code I use to save to a file and a screenshot.   MyBitmap::MyBitmap( int iWidth, int iHeight, int iNoOfBits, BYTE* pPixelData, size_t sPixelDataSize ) { _header.bfType = 0x4d42; _header.bfSize = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) + sPixelDataSize; _header.bfReserved1 = 0; _header.bfReserved2 = 0; _header.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ); _info.biSize = sizeof( _info ); _info.biWidth = iWidth; _info.biHeight = iHeight; _info.biPlanes = 1; _info.biBitCount = 24;//iNoOfBits; _info.biCompression = BI_RGB; _info.biSizeImage = iWidth* iHeight * 3; _info.biXPelsPerMeter = 0; _info.biYPelsPerMeter = 0; _info.biClrUsed = 0; _info.biClrImportant = 0; _info.biXPelsPerMeter = 0; _info.biYPelsPerMeter = 0; _pPixelData = pPixelData; _sPixelDataSize = sPixelDataSize; } MyBitmap::~MyBitmap() { if ( _pPixelData ) delete _pPixelData; } void MyBitmap::WriteToFile( std::string sFileName ) { std::ofstream file; file.open( sFileName.c_str(), std::ios::binary ); //write headers file.write( ( char* ) ( &_header ), sizeof( _header ) ); file.write( ( char* ) ( &_info ), sizeof( _info ) ); //write pixel data file.write( reinterpret_cast<char*>( &_pPixelData[0] ), _sPixelDataSize ); file.close(); } And here is how its used glReadPixels( 0, 0, g_iScreenWidth, g_iScreenHeight, GL_RGB, GL_UNSIGNED_BYTE, g_pixels ); MyBitmap bitmap( g_iScreenWidth, g_iScreenHeight, 24, g_pixels, 3 * g_iScreenWidth * g_iScreenHeight ); bitmap.WriteToFile( "test.bmp" ); The only thing I can think of is that I need to specify an RGB colour mask but that would require switching to BITMAPV4HEADER structure, which I have yet to see anyone recommend to use.    I am missing something painfully obvious?
  11. Ahh I though that I would have to convert to CLI. I decided to create Header and info structures then write them to a buffer manually. Thanks for the additional knowledge guys :)
  12. Sorry for the such a basic question (I very rarely use visual c++) but how do I use the .Net classes if I have a c++ console app in visual studio?
  13. What's the cleanest way to do what im trying to achieve?, Atm im thinking of making my own bitmap class and using boost to serialize it but it seems a little overkill