Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


bioglaze

Member Since 24 Oct 2012
Offline Last Active Yesterday, 09:30 AM

#5242787 Pimpl and potential alternatives

Posted by bioglaze on 26 July 2015 - 11:40 AM

Pimpl can be implemented without dynamic allocation with C++11:

.hpp:

class Test
{
private:
        struct Impl;
        Impl& m() { return reinterpret_cast<Impl&>(_storage); }
        Impl const& m() const { return reinterpret_cast<Impl const&>(_storage); }
        
        static const std::size_t StorageSize = 1384;
        static const std::size_t StorageAlign = 16;
        
        std::aligned_storage<StorageSize, StorageAlign>::type _storage;
};

.cpp:

Test::Test()
{
    new(&_storage)Impl();
}

Test::~Test()
{
    reinterpret_cast< Impl* >(&_storage)->~Impl();
}

// TODO: also implement copy constructor and assignment operator.



#5233999 Resources for refreshing C++ skills

Posted by bioglaze on 10 June 2015 - 12:20 AM

http://herbsutter.com/elements-of-modern-c-style/

Book: Effective Modern C++ by Scott Meyers




#5217581 How 3D engines were made in the 80's and 90's without using any graph...

Posted by bioglaze on 19 March 2015 - 01:56 AM

Back in the day I learned software rasterization and engine coding from this tutorial: 3DICA




#5208832 Next-Gen OpenGL To Be Shown Off Next Month

Posted by bioglaze on 05 February 2015 - 01:52 AM

I'm waiting for this talk and luckily will be able to attend it live. Will definitely write a blog post afterwards.




#5208830 Any cool books out there on Game Programming tips

Posted by bioglaze on 05 February 2015 - 01:30 AM

GPU Pro is also a great book series.




#5208600 Asset for testing normal mapping

Posted by bioglaze on 04 February 2015 - 05:43 AM

On this topic, does anyone know of any place to get test assets for a "typical" PBR pipeline? I.e. diffuse-, spec-, gloss/roughness-, spec-power,masking- and normal/heightmaps (and other stuff I can't think of?).

 

I haven't personally tested this, but bookmarked some time ago, they claim to support PBR: http://gametextures.com/




#5208175 Clean up and what to keep in mind

Posted by bioglaze on 02 February 2015 - 06:38 AM

Some points are slightly off-topic, but these are some of the things I do to maintain code quality:

 

* Avoid mutable global state including static variables inside methods

* Make sure that classes and methods do not do too many things ("Separation of Concerns")

* Avoid boolean parameters to functions, they are not very readable and are often used to select code paths that belong to their own separate functions

* Express intent by using algorithms instead of loops, wrapping stuff into well-named methods etc.

* Use forward-declarations as much as possible

* Declare everything const and use non-const variables only when you have to

* Avoid too many method parameters

* Read Effective C++ series

* Use static-analysis tools like CppCheck and PVS-Studio and high warning level in your compiler

* Compile your code using different compilers to find missing STL #includes and non-standard code




#5203665 Handmade Hero discussion thread

Posted by bioglaze on 12 January 2015 - 08:14 AM

I have been enjoying the series even though I'm an experienced engine/game/graphics programmer. Always learning some little things.




#5202585 Writing a game in Erlang, tips wanted!

Posted by bioglaze on 07 January 2015 - 07:28 AM

This blog has many posts on Erlang and concurrent/functional game development in general:

http://prog21.dadgum.com/




#5197556 Current-Gen Lighting

Posted by bioglaze on 11 December 2014 - 05:48 AM

To add to L.Spiro's list, read on Image-Based Lighting (IBL), Cook-Torrance, energy conservation, Tonemapping, ambient obscurance etc.




#5195648 Unity or C++?

Posted by bioglaze on 01 December 2014 - 01:39 AM

You'll learn different things, so I'd go for both using an existing engine and maybe later try making your own. I've done mostly my own engines but at the cost that I haven't finished many games.




#5195138 Critique My Implementation Of Pong?

Posted by bioglaze on 28 November 2014 - 04:09 AM

* You are including unnecessary files in headers and are not using forward declarations.

* Some of your shaders are version 330 and some are 410.




#5189351 Mac or PC - Really, this is a programming question.

Posted by bioglaze on 27 October 2014 - 01:37 AM

Mostly Mac/Xcode, but also Xamarin, Xubuntu, Emacs, Windows 8 and VS2013. Most of my projects work on all big operating systems.




#5185504 [Issue Solved]

Posted by bioglaze on 07 October 2014 - 05:38 AM

It would be nice to know what the issue was and how it was solved. As is, this thread adds no value.




#5172562 FBX model load

Posted by bioglaze on 10 August 2014 - 01:56 AM

Tell me what format 3D models for games is better to choose?

 

Games usually have their own model formats to keep runtime dependencies low and loading performance high.






PARTNERS