2014-09-27 18:03:51 +00:00
|
|
|
/*
|
2015-10-22 05:13:26 +00:00
|
|
|
* Apple // emulator for *ix
|
2014-10-08 04:59:21 +00:00
|
|
|
*
|
|
|
|
* This software package is subject to the GNU General Public License
|
2015-10-22 05:13:26 +00:00
|
|
|
* version 3 or later (your choice) as published by the Free Software
|
2014-10-08 04:59:21 +00:00
|
|
|
* Foundation.
|
|
|
|
*
|
2015-10-22 05:13:26 +00:00
|
|
|
* Copyright 2013-2015 Aaron Culliney
|
2014-10-08 04:59:21 +00:00
|
|
|
*
|
2014-09-27 18:03:51 +00:00
|
|
|
*/
|
|
|
|
|
2014-10-08 04:59:21 +00:00
|
|
|
// Modified sample code from https://developer.apple.com/library/mac/samplecode/GLEssentials/Introduction/Intro.html
|
|
|
|
|
2014-09-27 18:03:51 +00:00
|
|
|
#ifndef __SOURCE_UTIL_H__
|
|
|
|
#define __SOURCE_UTIL_H__
|
|
|
|
|
2016-01-02 18:53:28 +00:00
|
|
|
#include "common.h"
|
2014-09-27 18:03:51 +00:00
|
|
|
|
2014-10-08 04:59:21 +00:00
|
|
|
typedef struct demoSourceRec {
|
|
|
|
GLchar *string;
|
|
|
|
GLsizei byteSize;
|
|
|
|
GLenum shaderType; // Vertex or Fragment
|
2014-09-27 18:03:51 +00:00
|
|
|
} demoSource;
|
|
|
|
|
2016-01-02 18:53:28 +00:00
|
|
|
// Create a shader source object from a shader source file
|
|
|
|
extern demoSource *glshader_createSource(const char *filepathname);
|
2014-09-27 18:03:51 +00:00
|
|
|
|
2016-01-02 18:53:28 +00:00
|
|
|
// Destroy a shader source object
|
|
|
|
extern void glshader_destroySource(demoSource *source);
|
|
|
|
|
|
|
|
// Builds a GL program from shader sources
|
2016-01-02 21:10:02 +00:00
|
|
|
extern GLuint glshader_buildProgram(demoSource *vertexSource, demoSource *fragmentSource, /*bool hasNormal, */bool hasTexcoord, OUTPARM GLuint *vertexShader, OUTPARM GLuint *fragShader);
|
2014-09-27 18:03:51 +00:00
|
|
|
|
|
|
|
#endif // __SOURCE_UTIL_H__
|