#include "quakedef.h"
-#ifdef _WIN32
+#ifdef USE_DSOUND
#include <windows.h>
#include <dsound.h>
extern DWORD gSndBufSize;
else
clear = 0;
-#ifdef _WIN32
+#ifdef USE_DSOUND
if (pDSBuf)
{
DWORD dwSize;
void S_ExtraUpdate (void)
{
-#ifdef _WIN32
+#ifdef USE_DSOUND
IN_Accumulate ();
#endif
if (endtime > (unsigned int)(soundtime + samps))
endtime = soundtime + samps;
-#ifdef _WIN32
+#ifdef USE_DSOUND
// if the buffer was lost or stopped, restore it and/or restart it
{
DWORD dwStatus;
#ifndef SOUND_H
#define SOUND_H
+//AK: TODO: find a better solution instead of using a define
+#if defined( _WIN32 ) && !defined( USE_SDL )
+# define USE_DSOUND
+#endif
+
#define DEFAULT_SOUND_PACKET_VOLUME 255
#define DEFAULT_SOUND_PACKET_ATTENUATION 1.0
void Sys_UnloadLibrary (dllhandle_t* handle);
void* Sys_GetProcAddress (dllhandle_t handle, const char* name);
+void Sys_Print(const char *msg);
+void Sys_Printf(const char *fmt, ...);
+// send text to the quake console (and possibly to terminal)
+
+// called after Com_InitArgv
+void Sys_Shared_EarlyInit (void);
+// called after Host_init
+void Sys_Shared_LateInit (void);
+
+// returns current timestamp
+char *Sys_TimeString(const char *timeformat);
//
-// system IO
+// system IO interface (these are the sys functions that need to be implemented in a new driver atm)
//
void Sys_Error (const char *error, ...);
// an error will cause the entire program to exit
-void Sys_Print(const char *msg);
-void Sys_Printf(const char *fmt, ...);
-// send text to the quake console (and possibly to terminal)
-
void Sys_PrintToTerminal(const char *text);
// (may) output text to terminal which launched program
void Sys_SendKeyEvents (void);
// Perform Key_Event () callbacks until the input que is empty
-// called after Com_InitArgv
-void Sys_Shared_EarlyInit (void);
-// called after Host_init
-void Sys_Shared_LateInit (void);
-
-// returns current timestamp
-char *Sys_TimeString(const char *timeformat);
-
#endif
Sleep(milliseconds);
}
-
-void Sys_SendKeyEvents (void)
-{
- MSG msg;
-
- while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
- {
- // we always update if there are any event, even if we're paused
- scr_skipupdate = 0;
-
- if (!GetMessage (&msg, NULL, 0, 0))
- Sys_Quit ();
-
- TranslateMessage (&msg);
- DispatchMessage (&msg);
- }
-}
-
-
/*
==============================================================================
HICON icon;
// set the caption
- //SDL_WM_SetCaption( gamename, NULL );
+ SDL_WM_SetCaption( gamename, NULL );
// get the HWND handle
SDL_VERSION( &info.version );
if( !SDL_GetWMInfo( &info ) )
return;
- icon = LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( IDI_ICON1 ) );
- //icon = LoadIcon( NULL, IDI_ERROR );
- SetClassLong( info.window, GCL_HICONSM, (LONG) icon );
+ //icon = LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( IDI_ICON1 ) );
+ icon = LoadIcon( NULL, IDI_ERROR );
+ SetClassLong( info.window, GCL_HICON, (LONG) icon );
}
#else
static void VID_SetCaption()
VID_Shutdown();
return false;
}
-
+ VID_SetCaption();
gl_renderer = qglGetString(GL_RENDERER);
gl_vendor = qglGetString(GL_VENDOR);
vid_activewindow = false;
vid_usingmouse = false;
IN_Init();
- VID_SetCaption();
return true;
}
}
}
+//TODO: move it around in vid_wgl.c since I dont think this is the right position
+void Sys_SendKeyEvents (void)
+{
+ MSG msg;
+
+ while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))
+ {
+ // we always update if there are any event, even if we're paused
+ scr_skipupdate = 0;
+
+ if (!GetMessage (&msg, NULL, 0, 0))
+ Sys_Quit ();
+
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
+ }
+}
+
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
/* main window procedure */