Fixed namespace pollution due to a number of global symbols missing an fg prefix
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1846 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
f645974902
commit
2239d6c54d
@ -45,8 +45,8 @@ typedef struct _serialport SERIALPORT;
|
||||
void fgPlatformRegisterDialDevice ( const char *dial_device ) {
|
||||
fgWarning("GLUT_HAS_DIAL_AND_BUTTON_BOX: not implemented");
|
||||
}
|
||||
SERIALPORT *serial_open ( const char *device ) { return NULL; }
|
||||
void serial_close(SERIALPORT *port) {}
|
||||
int serial_getchar(SERIALPORT *port) { return EOF; }
|
||||
int serial_putchar(SERIALPORT *port, unsigned char ch) { return 0; }
|
||||
void serial_flush ( SERIALPORT *port ) {}
|
||||
SERIALPORT *fg_serial_open ( const char *device ) { return NULL; }
|
||||
void fg_serial_close(SERIALPORT *port) {}
|
||||
int fg_serial_getchar(SERIALPORT *port) { return EOF; }
|
||||
int fg_serial_putchar(SERIALPORT *port, unsigned char ch) { return 0; }
|
||||
void fg_serial_flush ( SERIALPORT *port ) {}
|
||||
|
@ -71,11 +71,11 @@ typedef struct _serialport SERIALPORT;
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
extern SERIALPORT *serial_open ( const char *device );
|
||||
extern void serial_close ( SERIALPORT *port );
|
||||
extern int serial_getchar ( SERIALPORT *port );
|
||||
extern int serial_putchar ( SERIALPORT *port, unsigned char ch );
|
||||
extern void serial_flush ( SERIALPORT *port );
|
||||
extern SERIALPORT *fg_serial_open ( const char *device );
|
||||
extern void fg_serial_close ( SERIALPORT *port );
|
||||
extern int fg_serial_getchar ( SERIALPORT *port );
|
||||
extern int fg_serial_putchar ( SERIALPORT *port, unsigned char ch );
|
||||
extern void fg_serial_flush ( SERIALPORT *port );
|
||||
|
||||
extern void fgPlatformRegisterDialDevice ( const char *dial_device );
|
||||
static void send_dial_event(int dial, int value);
|
||||
@ -114,8 +114,8 @@ void fgInitialiseInputDevices ( void )
|
||||
fgPlatformRegisterDialDevice ( dial_device );
|
||||
|
||||
if ( !dial_device ) return;
|
||||
if ( !( dialbox_port = serial_open ( dial_device ) ) ) return;
|
||||
serial_putchar(dialbox_port,DIAL_INITIALIZE);
|
||||
if ( !( dialbox_port = fg_serial_open ( dial_device ) ) ) return;
|
||||
fg_serial_putchar(dialbox_port,DIAL_INITIALIZE);
|
||||
glutTimerFunc ( 10, poll_dials, 0 );
|
||||
fgState.InputDevsInitialised = GL_TRUE;
|
||||
}
|
||||
@ -128,7 +128,7 @@ void fgInputDeviceClose( void )
|
||||
{
|
||||
if ( fgState.InputDevsInitialised )
|
||||
{
|
||||
serial_close ( dialbox_port );
|
||||
fg_serial_close ( dialbox_port );
|
||||
dialbox_port = NULL;
|
||||
fgState.InputDevsInitialised = GL_FALSE;
|
||||
}
|
||||
@ -165,7 +165,7 @@ static void poll_dials ( int id )
|
||||
|
||||
if ( !dialbox_port ) return;
|
||||
|
||||
while ( (data=serial_getchar(dialbox_port)) != EOF )
|
||||
while ( (data=fg_serial_getchar(dialbox_port)) != EOF )
|
||||
{
|
||||
if ( ( dial_state > DIAL_WHICH_DEVICE ) || IS_DIAL_EVENT ( data ) )
|
||||
{
|
||||
@ -194,12 +194,12 @@ static void poll_dials ( int id )
|
||||
{
|
||||
fgState.InputDevsInitialised = GL_TRUE;
|
||||
dial_state = DIAL_WHICH_DEVICE;
|
||||
serial_putchar(dialbox_port,DIAL_SET_AUTO_DIALS);
|
||||
serial_putchar(dialbox_port,0xff);
|
||||
serial_putchar(dialbox_port,0xff);
|
||||
fg_serial_putchar(dialbox_port,DIAL_SET_AUTO_DIALS);
|
||||
fg_serial_putchar(dialbox_port,0xff);
|
||||
fg_serial_putchar(dialbox_port,0xff);
|
||||
}
|
||||
else /* Unknown data; try flushing. */
|
||||
serial_flush(dialbox_port);
|
||||
fg_serial_flush(dialbox_port);
|
||||
}
|
||||
|
||||
glutTimerFunc ( 2, poll_dials, 0 );
|
||||
|
@ -22,11 +22,11 @@ extern int fgPlatformSpaceballNumButtons(void);
|
||||
extern void fgPlatformSpaceballSetWindow(SFG_Window *window);
|
||||
|
||||
|
||||
int sball_initialized = 0;
|
||||
int fg_sball_initialized = 0;
|
||||
|
||||
void fgInitialiseSpaceball(void)
|
||||
{
|
||||
if(sball_initialized != 0) {
|
||||
if(fg_sball_initialized != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -40,9 +40,9 @@ void fgSpaceballClose(void)
|
||||
|
||||
int fgHasSpaceball(void)
|
||||
{
|
||||
if(sball_initialized == 0) {
|
||||
if(fg_sball_initialized == 0) {
|
||||
fgInitialiseSpaceball();
|
||||
if(sball_initialized != 1) {
|
||||
if(fg_sball_initialized != 1) {
|
||||
fgWarning("fgInitialiseSpaceball failed\n");
|
||||
return 0;
|
||||
}
|
||||
@ -53,9 +53,9 @@ int fgHasSpaceball(void)
|
||||
|
||||
int fgSpaceballNumButtons(void)
|
||||
{
|
||||
if(sball_initialized == 0) {
|
||||
if(fg_sball_initialized == 0) {
|
||||
fgInitialiseSpaceball();
|
||||
if(sball_initialized != 1) {
|
||||
if(fg_sball_initialized != 1) {
|
||||
fgWarning("fgInitialiseSpaceball failed\n");
|
||||
return 0;
|
||||
}
|
||||
@ -66,9 +66,9 @@ int fgSpaceballNumButtons(void)
|
||||
|
||||
void fgSpaceballSetWindow(SFG_Window *window)
|
||||
{
|
||||
if(sball_initialized == 0) {
|
||||
if(fg_sball_initialized == 0) {
|
||||
fgInitialiseSpaceball();
|
||||
if(sball_initialized != 1) {
|
||||
if(fg_sball_initialized != 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -38,11 +38,11 @@ typedef struct {
|
||||
} SERIALPORT;
|
||||
|
||||
/* Serial Port Prototypes */
|
||||
SERIALPORT *serial_open ( const char *device );
|
||||
void serial_close ( SERIALPORT *port );
|
||||
int serial_getchar ( SERIALPORT *port );
|
||||
int serial_putchar ( SERIALPORT *port, unsigned char ch );
|
||||
void serial_flush ( SERIALPORT *port );
|
||||
SERIALPORT *fg_serial_open ( const char *device );
|
||||
void fg_serial_close ( SERIALPORT *port );
|
||||
int fg_serial_getchar ( SERIALPORT *port );
|
||||
int fg_serial_putchar ( SERIALPORT *port, unsigned char ch );
|
||||
void fg_serial_flush ( SERIALPORT *port );
|
||||
|
||||
|
||||
void fgPlatformRegisterDialDevice ( const char *dial_device )
|
||||
@ -63,7 +63,7 @@ void fgPlatformRegisterDialDevice ( const char *dial_device )
|
||||
|
||||
|
||||
/* Serial Port Functions */
|
||||
SERIALPORT *serial_open(const char *device){
|
||||
SERIALPORT *fg_serial_open(const char *device){
|
||||
HANDLE fh;
|
||||
DCB dcb={sizeof(DCB)};
|
||||
COMMTIMEOUTS timeouts;
|
||||
@ -90,12 +90,12 @@ SERIALPORT *serial_open(const char *device){
|
||||
timeouts.WriteTotalTimeoutConstant=1;
|
||||
SetCommTimeouts(fh,&timeouts);
|
||||
|
||||
serial_flush(port);
|
||||
fg_serial_flush(port);
|
||||
|
||||
return port;
|
||||
}
|
||||
|
||||
void serial_close(SERIALPORT *port){
|
||||
void fg_serial_close(SERIALPORT *port){
|
||||
if (port){
|
||||
/* restore old port settings */
|
||||
SetCommState(port->fh,&port->dcb_save);
|
||||
@ -105,7 +105,7 @@ void serial_close(SERIALPORT *port){
|
||||
}
|
||||
}
|
||||
|
||||
int serial_getchar(SERIALPORT *port){
|
||||
int fg_serial_getchar(SERIALPORT *port){
|
||||
DWORD n;
|
||||
unsigned char ch;
|
||||
if (!port) return EOF;
|
||||
@ -114,13 +114,13 @@ int serial_getchar(SERIALPORT *port){
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int serial_putchar(SERIALPORT *port, unsigned char ch){
|
||||
int fg_serial_putchar(SERIALPORT *port, unsigned char ch){
|
||||
DWORD n;
|
||||
if (!port) return 0;
|
||||
return WriteFile(port->fh,&ch,1,&n,NULL);
|
||||
}
|
||||
|
||||
void serial_flush ( SERIALPORT *port )
|
||||
void fg_serial_flush ( SERIALPORT *port )
|
||||
{
|
||||
FlushFileBuffers(port->fh);
|
||||
}
|
||||
|
@ -49,17 +49,17 @@ enum {
|
||||
SPNAV_EVENT_BUTTON /* includes both press and release */
|
||||
};
|
||||
|
||||
extern int sball_initialized;
|
||||
extern int fg_sball_initialized;
|
||||
unsigned int __fgSpaceKeystate = 0;
|
||||
RAWINPUTDEVICE __fgSpaceball = { 0x01, 0x08, 0x00, 0x00 };
|
||||
|
||||
void fgPlatformInitializeSpaceball(void)
|
||||
{
|
||||
HWND hwnd;
|
||||
sball_initialized = 1;
|
||||
fg_sball_initialized = 1;
|
||||
if (!fgStructure.CurrentWindow)
|
||||
{
|
||||
sball_initialized = 0;
|
||||
fg_sball_initialized = 0;
|
||||
return;
|
||||
}
|
||||
hwnd = fgStructure.CurrentWindow->Window.Handle;
|
||||
@ -72,7 +72,7 @@ void fgPlatformInitializeSpaceball(void)
|
||||
|
||||
if (!ok){
|
||||
__fgSpaceball.hwndTarget = NULL;
|
||||
sball_initialized = 0;
|
||||
fg_sball_initialized = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -113,10 +113,10 @@ void fgSpaceballHandleWinEvent(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
UINT res;
|
||||
RID_DEVICE_INFO sRidDeviceInfo;
|
||||
|
||||
if (!sball_initialized)
|
||||
if (!fg_sball_initialized)
|
||||
{
|
||||
fgPlatformInitializeSpaceball();
|
||||
if (!sball_initialized)
|
||||
if (!fg_sball_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ struct _serialport {
|
||||
|
||||
typedef struct _serialport SERIALPORT;
|
||||
|
||||
void serial_flush ( SERIALPORT *port );
|
||||
void fg_serial_flush ( SERIALPORT *port );
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
@ -59,7 +59,7 @@ void fgPlatformRegisterDialDevice ( const char *dial_device )
|
||||
{
|
||||
}
|
||||
|
||||
SERIALPORT *serial_open ( const char *device )
|
||||
SERIALPORT *fg_serial_open ( const char *device )
|
||||
{
|
||||
int fd;
|
||||
struct termios termio;
|
||||
@ -88,11 +88,11 @@ SERIALPORT *serial_open ( const char *device )
|
||||
cfsetospeed(&termio, B9600);
|
||||
tcsetattr(fd,TCSANOW,&termio);
|
||||
|
||||
serial_flush(port);
|
||||
fg_serial_flush(port);
|
||||
return port;
|
||||
}
|
||||
|
||||
void serial_close(SERIALPORT *port)
|
||||
void fg_serial_close(SERIALPORT *port)
|
||||
{
|
||||
if (port)
|
||||
{
|
||||
@ -103,7 +103,7 @@ void serial_close(SERIALPORT *port)
|
||||
}
|
||||
}
|
||||
|
||||
int serial_getchar(SERIALPORT *port)
|
||||
int fg_serial_getchar(SERIALPORT *port)
|
||||
{
|
||||
unsigned char ch;
|
||||
if (!port) return EOF;
|
||||
@ -111,13 +111,13 @@ int serial_getchar(SERIALPORT *port)
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int serial_putchar(SERIALPORT *port, unsigned char ch)
|
||||
int fg_serial_putchar(SERIALPORT *port, unsigned char ch)
|
||||
{
|
||||
if (!port) return 0;
|
||||
return write(port->fd,&ch,1);
|
||||
}
|
||||
|
||||
void serial_flush ( SERIALPORT *port )
|
||||
void fg_serial_flush ( SERIALPORT *port )
|
||||
{
|
||||
tcflush ( port->fd, TCIOFLUSH );
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
extern int sball_initialized;
|
||||
extern int fg_sball_initialized;
|
||||
|
||||
enum {
|
||||
SPNAV_EVENT_ANY, /* used by spnav_remove_events() */
|
||||
@ -56,17 +56,17 @@ void fgPlatformInitializeSpaceball(void)
|
||||
{
|
||||
Window w;
|
||||
|
||||
sball_initialized = 1;
|
||||
fg_sball_initialized = 1;
|
||||
if(!fgStructure.CurrentWindow)
|
||||
{
|
||||
sball_initialized = -1;
|
||||
fg_sball_initialized = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
w = fgStructure.CurrentWindow->Window.Handle;
|
||||
if(spnav_x11_open(fgDisplay.pDisplay.Display, w) == -1)
|
||||
{
|
||||
sball_initialized = -1;
|
||||
fg_sball_initialized = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ int fgIsSpaceballXEvent(const XEvent *xev)
|
||||
fgSpaceballSetWindow(fgStructure.CurrentWindow);
|
||||
}
|
||||
|
||||
if(sball_initialized != 1) {
|
||||
if(fg_sball_initialized != 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -116,9 +116,9 @@ void fgSpaceballHandleXEvent(const XEvent *xev)
|
||||
{
|
||||
spnav_event sev;
|
||||
|
||||
if(sball_initialized == 0) {
|
||||
if(fg_sball_initialized == 0) {
|
||||
fgInitialiseSpaceball();
|
||||
if(sball_initialized != 1) {
|
||||
if(fg_sball_initialized != 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
extern int fgPlatformGetModifiers( int state );
|
||||
|
||||
/* extension opcode for XInput */
|
||||
int xi_opcode = -1;
|
||||
static int xi_opcode = -1;
|
||||
|
||||
/**
|
||||
* \brief Sets window up for XI2 events.
|
||||
|
Reference in New Issue
Block a user