GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
Shader.cc File Reference
#include "Shader.hh"
#include "VectorTools.hh"
#include <vector>
#include <algorithm>
#include "Effect.hh"
#include <fstream>
#include "GraphI.hh"
#include "GameApi_low.hh"
#include "GameApi.hh"
Include dependency graph for Shader.cc:

Classes

struct  ShaderPriv
struct  ProgramPriv
struct  replace_c_params
struct  ShaderCacheItem
struct  ParseResult

Macros

#define NO_SDL_GLEXT
#define HAS_GL_GETERROR   1

Functions

std::string funccall_to_string (ShaderModule *mod)
std::string funccall_to_string_with_replace (ShaderModule *mod, std::string name, std::string value)
IMPORT void InstallProgress (int num, std::string label, int max)
IMPORT void ProgressBar (int num, int val, int max, std::string label)
unsigned int test_color2 (int id, unsigned int color)
std::string NumToString (int val)
std::string stringify (int i)
std::string get_uber_shader (bool oldshader, bool webgl2, bool emscripten, bool apple)
std::vector< std::string > replace_c_template_unique_ids (std::string defines, std::string define)
bool is_in_defines (std::string defines, std::string label)
std::string replace_c (const replace_c_params &pp)
std::string add_line_numbers (std::string s)
void clear_shader_cache ()
bool operator== (const ShaderCacheItem &i1, const ShaderCacheItem &i2)
const ShaderCacheItem * find_from_shader_cache (const ShaderCacheItem &i2)
template<class T>
std::ostream & operator<< (std::ostream &o, const std::vector< T > &v)
std::string trim (std::string s)
std::vector< std::string > parse_array (std::string s)
ParseResult parse_fcall (std::string s)
void UpdateAnim (Anim &anim, AnimState &state, const std::vector< Attrib > &attribs)
void DrawAnim (float start, float end, AnimState &state, const std::vector< Attrib > &attribs)

Variables

Program * current_program =0
std::unordered_map< Program *, Program * > program_map
std::vector< int > id_list2 = { 3,0 }
std::string g_gpu_vendor
std::vector< ShaderCacheItem > shader_cache
bool g_shader_cache_disable =false
bool g_shader_from_cache = false

Macro Definition Documentation

◆ HAS_GL_GETERROR

#define HAS_GL_GETERROR   1

◆ NO_SDL_GLEXT

#define NO_SDL_GLEXT

Function Documentation

◆ add_line_numbers()

std::string add_line_numbers ( std::string s)

◆ clear_shader_cache()

void clear_shader_cache ( )
Here is the caller graph for this function:

◆ DrawAnim()

void DrawAnim ( float start,
float end,
AnimState & state,
const std::vector< Attrib > & attribs )
Here is the caller graph for this function:

◆ find_from_shader_cache()

const ShaderCacheItem * find_from_shader_cache ( const ShaderCacheItem & i2)
Here is the caller graph for this function:

◆ funccall_to_string()

std::string funccall_to_string ( ShaderModule * mod)
Here is the caller graph for this function:

◆ funccall_to_string_with_replace()

std::string funccall_to_string_with_replace ( ShaderModule * mod,
std::string name,
std::string value )
Here is the caller graph for this function:

◆ get_uber_shader()

std::string get_uber_shader ( bool oldshader,
bool webgl2,
bool emscripten,
bool apple )

" ex_Normal2 = n;\n"

" jointMatrix[int(JOINTS_0.y)] +\n"

" ex_Position = vec3(vec4(in_Position,1.0) * in_InstMat);\n"

Here is the caller graph for this function:

◆ InstallProgress()

IMPORT void InstallProgress ( int num,
std::string label,
int max )

◆ is_in_defines()

bool is_in_defines ( std::string defines,
std::string label )

◆ NumToString()

std::string NumToString ( int val)
Here is the caller graph for this function:

◆ operator<<()

template<class T>
std::ostream & operator<< ( std::ostream & o,
const std::vector< T > & v )

◆ operator==()

bool operator== ( const ShaderCacheItem & i1,
const ShaderCacheItem & i2 )

◆ parse_array()

std::vector< std::string > parse_array ( std::string s)
Here is the caller graph for this function:

◆ parse_fcall()

ParseResult parse_fcall ( std::string s)

◆ ProgressBar()

IMPORT void ProgressBar ( int num,
int val,
int max,
std::string label )

std::cout << "ProgressBar: '" << num << " " << label << " " << val << " " << max << "'" << std::endl;

◆ replace_c()

std::string replace_c ( const replace_c_params & pp)
Here is the caller graph for this function:

◆ replace_c_template_unique_ids()

std::vector< std::string > replace_c_template_unique_ids ( std::string defines,
std::string define )
Here is the caller graph for this function:

◆ stringify()

std::string stringify ( int i)
Here is the caller graph for this function:

◆ test_color2()

unsigned int test_color2 ( int id,
unsigned int color )
Here is the caller graph for this function:

◆ trim()

std::string trim ( std::string s)
Here is the caller graph for this function:

◆ UpdateAnim()

void UpdateAnim ( Anim & anim,
AnimState & state,
const std::vector< Attrib > & attribs )
Here is the caller graph for this function:

Variable Documentation

◆ current_program

Program* current_program =0

◆ g_gpu_vendor

std::string g_gpu_vendor
extern

◆ g_shader_cache_disable

bool g_shader_cache_disable =false

◆ g_shader_from_cache

bool g_shader_from_cache = false

◆ id_list2

std::vector<int> id_list2 = { 3,0 }

◆ program_map

std::unordered_map< Program *, Program * > program_map

◆ shader_cache

std::vector<ShaderCacheItem> shader_cache