/* date = July 12th 2023 5:42 pm */

#ifndef RENDER_CONTEXT_H
#define RENDER_CONTEXT_H

////////////////////////////////
// NOTE(allen): Renderer Context Cracking

// NOTE(allen): Zero any missing selectors
#if !defined(R_BACKEND_OGL)
# define R_BACKEND_OGL 0
#endif
#if !defined(R_BACKEND_D3D11)
# define R_BACKEND_D3D11 0
#endif

#define R_BACKEND_MIX (\
Boolify(R_BACKEND_OGL) + \
Boolify(R_BACKEND_D3D11) + \
0)

// NOTE(allen): Auto select a backend if none is selected
#if R_BACKEND_MIX == 0
# undef R_BACKEND_OGL
# define R_BACKEND_OGL 1
#endif

// NOTE(allen): Report error if multiple backends are selected
#if R_BACKEND_MIX > 1
# error more than one render backend is selected
# if R_BACKEND_OGL
#  error the OpenGL render backend is selected
# endif
# if R_BACKEND_D3D11
#  error the D3D11 render backend is selected
# endif
#endif

#endif //RENDER_CONTEXT_H
