2018-11-15 23:42:29 +00:00
|
|
|
/*****************************************************************************\
|
|
|
|
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
|
|
|
This file is licensed under the Snes9x License.
|
|
|
|
For further information, consult the LICENSE file in the root directory.
|
|
|
|
\*****************************************************************************/
|
|
|
|
|
2018-05-11 20:56:58 +00:00
|
|
|
#ifndef __SHADER_HELPERS_H
|
|
|
|
#define __SHADER_HELPERS_H
|
2018-05-10 23:47:55 +00:00
|
|
|
|
2018-05-13 23:12:30 +00:00
|
|
|
#include "shader_platform.h"
|
2019-01-13 17:39:54 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
2018-05-10 23:47:55 +00:00
|
|
|
|
|
|
|
typedef struct _STGA
|
|
|
|
{
|
|
|
|
_STGA()
|
|
|
|
{
|
2019-01-08 23:18:17 +00:00
|
|
|
data = (unsigned char *)0;
|
2018-05-10 23:47:55 +00:00
|
|
|
width = 0;
|
|
|
|
height = 0;
|
|
|
|
byteCount = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
~_STGA()
|
|
|
|
{
|
|
|
|
delete[] data;
|
|
|
|
data = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void destroy()
|
|
|
|
{
|
|
|
|
delete[] data;
|
|
|
|
data = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
unsigned char byteCount;
|
2019-01-08 23:18:17 +00:00
|
|
|
unsigned char *data;
|
2018-05-10 23:47:55 +00:00
|
|
|
} STGA;
|
|
|
|
|
2019-01-08 23:18:17 +00:00
|
|
|
bool loadPngImage(const char *name, int &outWidth, int &outHeight,
|
|
|
|
bool &outHasAlpha, GLubyte **outData);
|
|
|
|
bool loadTGA(const char *filename, STGA &tgaFile);
|
2019-01-09 01:43:51 +00:00
|
|
|
void gl_log_errors();
|
|
|
|
bool gl_srgb_available();
|
|
|
|
int gl_version();
|
|
|
|
bool gl_float_texture_available();
|
2019-01-13 17:39:54 +00:00
|
|
|
void reduce_to_path(char* filename);
|
|
|
|
void read_shader_file_with_includes(std::string filename, std::vector<std::string> &lines);
|
2018-05-11 20:56:58 +00:00
|
|
|
|
|
|
|
#endif // __SHADER_HELPERS_H
|