* Copyright (c) 2014 Jinrong Xie. All Rights Reserved.
* Written by Jinrong Xie <stonexjr at gmail.com>
* Modification date: Wed Dec 24, 2014
-
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
*/
/*
- * Modified by Jinrong Xie (stonexjr@gmail.com) 12/24/2014
+ * Modified by Jinrong Xie <stonexjr at gmail.com> 12/24/2014
* for Space Navigator support on Windows.
* This code is enhanced by at least supporting 3Dconnexion's
* six degree of freedom navigator.
*/
+#if(_WIN32_WINNT >= 0x0501)
+
#include <GL/freeglut.h>
+#include <stdlib.h>
#include "../fg_internal.h"
enum {
void fgPlatformInitializeSpaceball(void)
{
HWND hwnd;
- sball_initialized = 1;
+ sball_initialized = 1;
if (!fgStructure.CurrentWindow)
{
sball_initialized = 0;
if (res == -1)
return;
- rawInputBuffer = (BYTE*)malloc(size);
+ rawInputBuffer = malloc(size * sizeof *rawInputBuffer);
pRawInput = (PRAWINPUT)rawInputBuffer;
res = GetRawInputData(hRawInput, RID_INPUT, pRawInput, &size, sizeof(RAWINPUTHEADER));
__fgSpaceKeystate = dwKeystate;
}
}
-}
\ No newline at end of file
+}
+
+#endif
\ No newline at end of file