I'm trying to load an openGL texture for a game. The texture is an image that has been exported as a .C source file
from GIMP. When I #include
this file in my project (using Visual C++ 2010 Ultimate), I get a compiler error saying fatal error C1091: compiler limit: string exceeds 65535 bytes in length
Is there any workaround ?
The reason I wanted to export the image as a C header file was so that the program compiles with the image, and I dont have to provide raw
image files along with the executable.
Code:
#include <iostream>
#include <Windows.h>
#include <glfw.h>
#include "X.c"
#define X 1
#define O 2
#pragma comment(lib, "glfw.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "gdi32.lib")
using namespace std;
float render();
void stepGame(float);
void keyboard(int, int);
int main(int argv, int *argc[])
{
glfwInit();
glfwOpenWindow(480, 480, 16, 16, 16, 16, 16, 16, GLFW_WINDOW);
glfwSetKeyCallback(keyboard);
glfwSetWindowTitle("Tic Tac Toe!");
glClearColor(1.0, 1.0, 1.0, 1.0);
float dT;
while(glfwGetWindowParam(GLFW_OPENED) > 0)
{
glfwPollEvents();
dT = render();
stepGame(dT);
}
return 0;
}
Image file: X.c