./blank.test
clean:
- rm -df $(OBJ) $(DEP) $(DIR)
+ rm -f $(OBJ)
+ rm -f $(DEP)
+ find build -type d -empty -delete
distclean: clean
rm -f $(BIN) cachegrind.out.* callgrind.out.*
}
}
-InitAL::~InitAL() {
+InitAL::~InitAL() throw(AlutError) {
if (!alutExit()) {
throw AlutError(alutGetError(), "alutExit");
}
public:
InitAL();
- ~InitAL();
+ ~InitAL() throw(AlutError);
InitAL(const InitAL &) = delete;
InitAL &operator =(const InitAL &) = delete;
#include "app/Runtime.hpp"
+#include <exception>
+#include <iostream>
+
using namespace blank;
int main(int argc, char *argv[]) {
Runtime rt;
- rt.Initialize(argc, argv);
- return rt.Execute();
+ try {
+ rt.Initialize(argc, argv);
+ } catch (std::exception &e) {
+ std::cerr << "error in initialization: " << e.what() << std::endl;
+ return 1;
+ } catch (...) {
+ std::cerr << "unknown error in initialization" << std::endl;
+ return 1;
+ }
+ try {
+ return rt.Execute();
+ } catch (std::exception &e) {
+ std::cerr << "error in execution: " << e.what() << std::endl;
+ return 2;
+ } catch (...) {
+ std::cerr << "unknown error in execution" << std::endl;
+ return 2;
+ }
}
Viewport(const Viewport &) = delete;
Viewport &operator =(const Viewport &) = delete;
- void VSync(bool b) noexcept;
+ void VSync(bool b);
void EnableDepthTest() noexcept;
void EqualDepthTest() noexcept;
#include <algorithm>
#include <cstring>
+#include <iostream>
#include <memory>
#include <stdexcept>
UnpackRowLength(0);
} else if (srf.w > (1 << 30) || srf.h > (1 << 30)) {
+ // That's at least one gigapixel in either or both dimensions.
+ // If this is not an error, that's an insanely large or high
+ // resolution texture.
#ifndef NDEBUG
- throw std::runtime_error("texture too large");
+ std::cerr << "texture size exceeds 2^30, aborting data import" << std::endl;
#endif
} else {
GLsizei width = 1, height = 1;
glClearColor(0.0, 0.0, 0.0, 1.0);
}
-void Viewport::VSync(bool b) noexcept {
+void Viewport::VSync(bool b) {
if (SDL_GL_SetSwapInterval(b) != 0) {
throw SDLError("SDL_GL_SetSwapInterval");
}
: types(&types)
, neighbor{0}
, gravity()
-, blocks{}
, light{0}
, generated(false)
, lighted(false)