示例#1
0
bool Shader::ReadFragmentShader(char *_fn)
{
	if(TextFileRead(_fn,m_FragmentShader))
		return true;
	else
		return false;
}
示例#2
0
bool Shader::ReadVertextShader(char *_fn)
{
	if(TextFileRead(_fn,m_VertexShader))
		return true;
	else
		return false;
}
示例#3
0
文件: main.cpp 项目: eddietree/tiger
int main( int argc, char *argv[] )
{
	gmMachine gm;

	if ( argc < 3 )
	{
		printf("Error, Please use: gmByteCoder.exe [SRC] [DEST]\n");
		return 1;
	}

	char * fileSrc = argv[1];
	char * fileDst = argv[2];

	// output lib
	gmStreamBufferDynamic writeBuffer;

	// load soure code
	char * srcCode = TextFileRead(fileSrc);
	if ( !srcCode ) 
	{
		printf("Cannot find file: %s\n", fileSrc );
		return 1;
	}

	gm.CompileStringToLib( srcCode, writeBuffer );

	FILE * fh;
	fh = std::fopen(fileDst, "wb");

	// check error
	if ( !fh )
	{
		printf("Cannot open destinatin file: %s\n", fileDst );
		delete[] srcCode;
		return 1;
	}

	fwrite( writeBuffer.GetData(), writeBuffer.GetSize(), 1, fh );
	fclose(fh);

	delete[] srcCode;

	return 0;
}