MCPcopy Create free account
hub / github.com/DentonW/DevIL / WndProc

Function WndProc

DevIL/examples/animation_example/AnimTest.cpp:230–363  ·  view source on GitHub ↗

Window procedure, handles all messages for this program

Source from the content-addressed store, hash-verified

228
229// Window procedure, handles all messages for this program
230LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
231{
232 static HMENU hMenu;
233 static ILuint Colours;
234 static RECT Rect;
235 static HDROP hDrop;
236
237 static char OpenFileName[2048];
238 static char OpenFilter[2048];
239 static char *OFilter[] = {
240 "All Files (*.*)", "*.*",
241 "Half-Life Model Files (*.mdl)", "*.mdl",
242 "Homeworld Image Files (*.lif)", "*.lif",
243 "Image Files (All Supported Types)", "*.jpe;*.jpg;*.jpeg;*.lif;*.bmp;*.ico;*.pbm;*.pgm;*.pnm;*.ppm;*.png;*.bw;*.rgb;*.rgba;*.sgi;*.tga;*.tif;*.tiff;*.pcx",
244 "Jpeg Files (*.jpe, *.jpg, *.jpeg)", "*.jpe;*.jpg;*.jpeg",
245 "Microsoft Bitmap Files (*.bmp)", "*.bmp",
246 "Microsoft Icon Files (*.ico)", "*.ico",
247 "OpenIL Files (*.oil)", "*.oil",
248 "Portable AnyMap Files (*.pbm, *.pgm, *.pnm, *.ppm)", "*.pbm;*.pgm;*.pnm;*.ppm",
249 "Portable Network Graphics Files (*.png)", "*.png",
250 "Sgi Files (*.sgi)", "*.bw;*.rgb;*.rgba;*.sgi",
251 "Targa Files (*.tga)", "*.tga",
252 "Tiff Files (*.tif)", "*.tif;*.tiff",
253 "Quake Wal Files (*.wal)", "*.wal",
254 "ZSoft Pcx Files (*.pcx)", "*.pcx",
255 "\0\0"
256 };
257
258 static OPENFILENAME Ofn = {
259 sizeof(OPENFILENAME),
260 hWnd,
261 NULL,
262 OpenFilter,
263 NULL,
264 0,
265 0,
266 OpenFileName,
267 512,
268 NULL,
269 0,
270 NULL,
271 NULL,
272 OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,
273 0,
274 0,
275 NULL,
276 NULL,
277 NULL,
278 NULL
279 };
280
281 switch (message)
282 {
283 case WM_CREATE:
284 GenFilterString(OpenFilter, OFilter);
285
286 hDC = GetDC(hWnd);
287 DragAcceptFiles(hWnd, TRUE);

Callers

nothing calls this directly

Calls 4

DisplayImageFunction · 0.85
LoadImagesFunction · 0.85
GenFilterStringFunction · 0.70
DestroyGDIFunction · 0.70

Tested by

no test coverage detected