Palm-Studios / sh3redux

SILENT HILL 3 Engine Remake in OpenGL and C++
GNU General Public License v3.0
158 stars 15 forks source link

Provide default constructors and move constructors to source (*.cpp) files. #112

Open Quaker762 opened 6 years ago

Quaker762 commented 6 years ago

Because some OGL objects need a context before they are initialised, I think it's best if we provide a default constructor so functions such as Load( ) (for example, a shader program) can be called later instead of being automatically called by the constructor.

This also makes a bit more sense, as the we can specify something like

sh3::gl::program test;test.Load("program");

instead of having to specify the program name when the object is declared, so we can defer the loading to when we actually need it (like loading an msbmp later, not during object construction).

This will mainly affect sh3::gl::program, sh3::graphics::texture, sh3::graphics::msbmp etc.