コード例 #1
0
void Application::initializeDevIL() {
	ilInit();
	iluInit();
	ilutInit();
	ilutRenderer(ILUT_OPENGL);
	ilutEnable(ILUT_OPENGL_CONV);
}
コード例 #2
0
ファイル: texture.cpp プロジェクト: jimfinnis/stumpy2
TextureManager::TextureManager(){
    ilInit();
    iluInit();
    ilEnable(IL_CONV_PAL);
    ilutRenderer(ILUT_OPENGL);
    ilutEnable(ILUT_OPENGL_CONV);
    
}
コード例 #3
0
void devil_init()
{
	ilInit();
	iluInit();
	ilutInit();
	ilutRenderer(ILUT_OPENGL);
	ilutEnable(ILUT_OPENGL_CONV);
}
コード例 #4
0
void cRenderer::initExternals(){
	glewExperimental = GL_TRUE;												//új GLEW extensionok 
	glewInit();																//GLEW inicializálása

	ilInit();																//DevIL / IL inicializálása
	iluInit();																//DevIL / ILU iniclializálása
	ilutRenderer(ILUT_OPENGL);												//DevIL OpenGL-re állítása
	ilEnable(IL_ORIGIN_SET);												//DevIL origin beállítása
	ilOriginFunc(IL_ORIGIN_LOWER_LEFT);										//DevIL bal lent legyen az origin
	ilutEnable(ILUT_GL_USE_S3TC);											//S3TC formátum használata
}
コード例 #5
0
ファイル: Textures.cpp プロジェクト: MaliusArth/PixelArth
void InitializeTextureLoading()
{
	#if !_ANGEL_DISABLE_DEVIL
		ilInit();
		iluInit();
		ilutInit();
		glDisable(GL_TEXTURE_2D);
		
		// Convert any paletted images
		ilEnable(IL_CONV_PAL);
		// Allegedly gets rid of dithering on some nvidia cards. 
		ilutEnable(ILUT_OPENGL_CONV);
	#endif
}
コード例 #6
0
ファイル: gltest.c プロジェクト: xksteven/myOpenGL
int main(int argc, char** argv)
{
	// No filename is specified on the command-line.
	if (argc < 2) {
		printf ("Please run as:\n\nDevIL_testGL image_filename\n");
		return 1;
	}
	FileName = argv[1];  // Set filename equal to the first argument.

	//
	// Check if the shared lib's version matches the executable's version.
	//



//
// fixed to get the right numbers from the right library call...
//
	if (ilGetInteger(IL_VERSION_NUM) < IL_VERSION ||
		iluGetInteger(ILU_VERSION_NUM) < ILU_VERSION ||
		ilutGetInteger(ILUT_VERSION_NUM) < ILUT_VERSION) {
		printf ("DevIL library is out of date! Please upgrade\n");
		return 2;
	}

	// Needed to initialize DevIL.
	ilInit ();
	iluInit();

	// GL cannot use palettes anyway, so convert early.
	ilEnable (IL_CONV_PAL);

	// Gets rid of dithering on some nVidia-based cards.
	ilutEnable (ILUT_OPENGL_CONV);

	// Generate the main image name to use.
	ilGenImages (1, &ImgId);
	
	// Bind this image name.
	ilBindImage (ImgId);

	// Loads the image specified by File into the ImgId image.
	if (!ilLoadImage(FileName)) {
		HandleDevILErrors ();
	}

	// Make sure the window is in the same proportions as the image.
	//  Generate the appropriate width x height less than or equal to MAX_X x MAX_Y.
	//	Instead of just clipping Width x Height to MAX_X x MAX_Y, we scale to
	//	an appropriate size, so the image isn't stretched/squished.
	Width  = ilGetInteger (IL_IMAGE_WIDTH);
	Height = ilGetInteger (IL_IMAGE_HEIGHT);
	
	if (Width > 0) {  // Don't want a divide by 0...
		if (Width > MAX_X) {
			Width = MAX_X;
			Height = (ILuint)(MAX_X / (ILfloat)ilGetInteger(IL_IMAGE_WIDTH) * Height);
		}
	}
	if (Height > 0) {  // Don't want a divide by 0...
		if (Height > MAX_Y) {
			Height = MAX_Y;
			Width = (ILuint)(MAX_Y / (ILfloat)ilGetInteger(IL_IMAGE_HEIGHT) * Width);
		}
	}

	HandleDevILErrors ();

	// Standard glut initializations.
	glutInit               (&argc, argv);  // Standard glut initialization.
	glutInitDisplayMode    (GLUT_RGB | GLUT_DOUBLE);
	glutInitWindowPosition (100, 100);
	glutInitWindowSize     (Width, Height);
	
	window = glutCreateWindow("Developer's Image Library (DevIL) Test");

	ilutInit();

	glutDisplayFunc  (DisplayFunc);
	glutKeyboardFunc (KeyboardFunc);

	// Goes into our setup function.
	if (Setup() == IL_FALSE)
		return 1;

	// Enter the main (Free)GLUT processing loop
	glutMainLoop();

	// Clean up any loose ends.
	CleanUp();

	return 0;
}
コード例 #7
0
ファイル: 3dtest.c プロジェクト: AMDmi3/DevIL
int main(int argc, char** argv)
{
	//char Test[6] = { 0, 0, 0, 0, 0, 0 };

	if (argc < 2) {
		//cout << "Please specify a filename." << endl;
		return 1;
	}
	File = argv[1];

	if (argc > 2) {
		TransFactor = atoi(argv[2]) != 0 ? -atoi(argv[2]) : TransFactor;
	}

	if (ilGetInteger(IL_VERSION_NUM) < IL_VERSION ||
		ilGetInteger(ILU_VERSION_NUM) < ILU_VERSION ||
		ilGetInteger(ILUT_VERSION_NUM) < ILUT_VERSION) {
		//cout << "OpenIL version is different...exiting!" << endl;
		return 2;
	}

	ilInit();
	//ilEnable(IL_CONV_PAL);
	ilutEnable(ILUT_OPENGL_CONV);

	glutInit(&argc, argv);

	ilGenImages(1, &ImgId);
	ilBindImage(ImgId);
	ilLoadImage(File);

	// Generate the appropriate width x height less than or equal to MAX_X x MAX_Y.
	//	Instead of just clipping Width x Height to MAX_X x MAX_Y, we scale to
	//	an appropriate size, so the image isn't stretched/squished.
	Width  = ilGetInteger(IL_IMAGE_WIDTH);
	Height = ilGetInteger(IL_IMAGE_HEIGHT);
	if (Width > 0) {  // Don't want a divide by 0...
		if (Width > MAX_X) {
			Width = MAX_X;
			Height = (ILuint)(MAX_X / (ILfloat)ilGetInteger(IL_IMAGE_WIDTH) * Height);
		}
	}
	if (Height > 0) {  // Don't want a divide by 0...
		if (Height > MAX_Y) {
			Height = MAX_Y;
			Width = (ILuint)(MAX_Y / (ILfloat)ilGetInteger(IL_IMAGE_HEIGHT) * Width);
		}
	}

    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
	glutInitWindowPosition(100, 100);
	glutInitWindowSize(Width, Height);

	Window = glutCreateWindow("Open Image Library (OpenIL) Test");
	glutDisplayFunc(DisplayFunc);
	glutKeyboardFunc(KeyboardFunc);
	glutSpecialFunc(KeySpecialFunc);
	if (Setup() == IL_FALSE)
		return 1;

    // Enter the main (Free)GLUT processing loop
    glutMainLoop();

	CleanUp();

    return 0;
}