quick boob
This commit is contained in:
parent
3cf8fd09cb
commit
b7a2e86477
5 changed files with 48 additions and 1 deletions
|
@ -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
14
src/client/common.hpp
Normal 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
|
|
@ -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);
|
||||||
|
|
2
src/client/shaders/_shader.cpp
Normal file
2
src/client/shaders/_shader.cpp
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#include "_shader.hpp"
|
||||||
|
|
27
src/client/shaders/_shader.hpp
Normal file
27
src/client/shaders/_shader.hpp
Normal 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
|
Loading…
Reference in a new issue