quick boob

This commit is contained in:
malloc 2018-08-17 11:01:45 -05:00
parent 3cf8fd09cb
commit b7a2e86477
5 changed files with 48 additions and 1 deletions

View file

@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
project(sockscape) project(sockscape)
string(COMPARE EQUAL ${CMAKE_BUILD_TYPE} Debug _CMP)
if(_CMP)
add_definitions("-DSOSC_DEBUG")
endif()
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)

14
src/client/common.hpp Normal file
View file

@ -0,0 +1,14 @@
#ifndef SOSC_CLIENT_COMMON_H
#define SOSC_CLIENT_COMMON_H
#include <string>
#ifdef SOSC_DEBUG
#define SOSC_RESOURCE_PATH (std::string("../resources/client/"))
#else
#define SOSC_RESOURCE_PATH (std::string("resources/"))
#endif
#define SOSC_RESC(X) (SOSC_RESOURCE_PATH + std::string(X))
#endif

View file

@ -42,7 +42,6 @@ int main(int argc, char* argv[]) {
bool running = true; bool running = true;
while(running) { while(running) {
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
SDL_GL_SwapWindow(window); SDL_GL_SwapWindow(window);

View file

@ -0,0 +1,2 @@
#include "_shader.hpp"

View file

@ -0,0 +1,27 @@
#ifndef SOSC_SHADER_CORE_H
#define SOSC_SHADER_CORE_H
#include "common.hpp"
#include <GL/glew.h>
#include <cstdarg>
class Shader {
public:
Shader();
bool Load();
void Start();
void Stop();
void Unload();
protected:
virtual bool PrepareLoad() = 0;
virtual void PrepareUnload() {};
bool AttachSource();
bool FetchUniforms(int count, GLint* ids, ...);
private:
GLuint program;
};
#endif