- Main Page
- Data Structures
- Files

- File List

# E:/DevIL/src-ILUT/src/ilut_main.c

    00001 //-----------------------------------------------------------------------------
    00002 //
    00003 // ImageLib Utility Toolkit Sources
    00004 // Copyright (C) 2000-2002 by Denton Woods
    00005 // Last modified: 05/28/2001 <--Y2K Compliant! =]
    00006 //
    00007 // Filename: src-ILUT/src/ilut_main.c
    00008 //
    00009 // Description: Startup functions
    00010 //
    00011 //-----------------------------------------------------------------------------
    00012
    00013
    00014 #include "ilut_internal.h"
    00015
    00016 #ifdef _WIN32
    00017 #ifndef IL_STATIC_LIB
    00018         //#define WIN32_LEAN_AND_MEAN
    00019         #include <windows.h>
    00020
    00021
    00022 #ifdef _WIN32
    00023         #if (defined(IL_USE_PRAGMA_LIBS))
    00024                 #if defined(_MSC_VER) || defined(__BORLANDC__)
    00025                         #pragma comment(lib, "ILU.lib")
    00026                 #endif
    00027         #endif
    00028 #endif
    00029
    00030
    00031
    00032 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
    00033 {
    00034         hModule;  lpReserved;
    00035
    00036         // only initialize when attached to a new process. setup can cause errors in OpenIL
    00037         // when called on a per thread basis
    00038         if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
    00039                 //ilutInit();
    00040         }
    00041
    00042         return TRUE;
    00043 }
    00044 #endif
    00045
    00046 #else  // Should check if gcc?
    00047
    00048 // Should be able to condense this...
    00049 static void GccMain() __attribute__((constructor));
    00050 static void GccMain()
    00051 {
    00052         //ilutInit();
    00053 }
    00054
    00055 #endif
    00056
    00057
    00058 void ILAPIENTRY ilutInit()
    00059 {
    00060         ilutDefaultStates();  // Set states to their defaults
    00061         // Can cause crashes if DevIL is not initialized yet
    00062
    00063 #ifdef ILUT_USE_OPENGL
    00064         ilutGLInit();  // default renderer is OpenGL
    00065 #endif
    00066
    00067 #ifdef ILUT_USE_DIRECTX8
    00068         ilutD3D8Init();
    00069 #endif
    00070
    00071 #ifdef ILUT_USE_DIRECTX9
    00072         ilutD3D9Init();
    00073 #endif
    00074
    00075         return;
    00076 }