CMSC23700 Common Code Library
Support code for CS23700 programming projects
Loading...
Searching...
No Matches
cs237.hpp
Go to the documentation of this file.
1
10/*
11 * COPYRIGHT (c) 2023 John Reppy (http://cs.uchicago.edu/~jhr)
12 * All rights reserved.
13 */
14
15#ifndef _CS237_HPP_
16#define _CS237_HPP_
17
18#include "cs237-config.h"
19
20#include <cmath>
21#include <cstdint>
22#include <cassert>
23#include <iostream>
24#include <memory>
25#include <string>
26#include <vector>
27#include <algorithm>
28
29/* GLM include files; we include the extensions, such as transforms
30 * and enable the experimental support for `to_string`
31 */
32#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
33#define GLM_FORCE_DEPTH_ZERO_TO_ONE
34#include "glm/glm.hpp"
35#define GLM_ENABLE_EXPERIMENTAL
36#include "glm/ext.hpp"
37
38/* The GLFW and Vulkan library */
39#define VULKAN_HPP_TYPESAFE_CONVERSION
40#include <vulkan/vulkan.hpp>
41
42/* The GLFW library */
43//#define GLFW_INCLUDE_VULKAN
44#include <GLFW/glfw3.h>
45
46namespace cs237 {
47
50[[ noreturn ]]
51inline void ReportError (const char *file, int line, std::string const &msg)
52{
53 std::string s = "[" + std::string(file) + ":" + std::to_string(line) + "] " + msg;
54 throw std::runtime_error(s);
55}
56
57} // namespace cs237
58
59#define ERROR(msg) cs237::ReportError (__FILE__, __LINE__, msg);
60
61/* CS23700 support files */
62#include "cs237-types.hpp"
63
64#include "cs237-shader.hpp"
65#include "cs237-pipeline.hpp"
66#include "cs237-application.hpp"
67#include "cs237-window.hpp"
68#include "cs237-memory-obj.hpp"
69#include "cs237-buffer.hpp"
70#include "cs237-image.hpp"
71#include "cs237-texture.hpp"
73
74/* geometric types */
75#include "cs237-aabb.hpp"
76#include "cs237-plane.hpp"
77
78/***** a wrapper for printing GLM vectors *****/
79template<glm::length_t L, typename T, glm::qualifier Q>
80std::ostream& operator<< (std::ostream& s, glm::vec<L,T,Q> const &v)
81{
82 return (s << glm::to_string(v));
83}
84
85#endif // !_CS237_HPP_
std::ostream & operator<<(std::ostream &s, glm::vec< L, T, Q > const &v)
Definition cs237.hpp:80
Definition cs237-aabb.hpp:22
void ReportError(const char *file, int line, std::string const &msg)
Definition cs237.hpp:51