?? win_fb.c
字號:
/*** $Id: win_fb.c,v 1.3 2005/06/08 02:36:27 weiym Exp $** ** win_fb.c: A subdriver of shadow NEWGAL engine for Windows WVFB 4bpp/1bpp.**** Copyring (C) 2003 ~ 2005 Feynman Software.*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/#include <stdio.h>#include <stdlib.h>#include "mgconfig.h"#if defined (_NEWGAL_ENGINE_SHADOW) && defined (WIN32) && defined (__TARGET_WVFB__)#include "windows.h"static HANDLE hMutex;static HANDLE hScreen;static LPVOID lpScreen;int wvfb_shadow_available (void){ hMutex = OpenMutex (MUTEX_MODIFY_STATE, FALSE, "WVFBScreenObject"); if (hMutex == 0 || hMutex == (HANDLE)ERROR_FILE_NOT_FOUND) { fprintf (stderr, "WVFB is not available!\n"); return 0; } return 1;}void *wvfb_shadow_init (){ hScreen = OpenFileMapping (FILE_MAP_ALL_ACCESS, FALSE, "WVFBScreenMap"); if (hScreen == NULL) { fprintf (stderr, "Could not open file mapping object WVFBScreenMap."); return NULL; } lpScreen = MapViewOfFile (hScreen, FILE_MAP_ALL_ACCESS, 0, 0, 0); if (lpScreen == NULL) { fprintf (stderr, "Could not map view of file."); return NULL; } return (void *)lpScreen;}void wvfb_shadow_close (void){ UnmapViewOfFile (lpScreen); CloseHandle (hScreen); CloseHandle (hMutex);}void wvfb_shadow_lock (void){ WaitForSingleObject (hMutex, INFINITE);}void wvfb_shadow_unlock (void){ ReleaseMutex (hMutex);}#endif /* _NEWGAL_ENGINE_SHADOW && WIN32 && __TARGET_WVFB__ */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -