Changeset 3083 for trunk/src/opengl/glut


Ignore:
Timestamp:
Mar 11, 2000, 4:07:48 PM (25 years ago)
Author:
sandervl
Message:

compile fixes + cleanup

Location:
trunk/src/opengl/glut
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/glut/Makefile

    r3040 r3083  
    1 # $Id: Makefile,v 1.13 2000-03-08 09:07:24 bird Exp $
     1# $Id: Makefile,v 1.14 2000-03-11 15:07:43 sandervl Exp $
    22
    33#
     
    2121CLEANEXTRAS = 32rsrc.asm
    2222
    23 CFLAGS      = -Tdp -I..\mesa\GL -I..\glu $(CFLAGS) -I..\mesa
    24 CXXFLAGS    = -Tdp -I..\mesa\GL -I..\glu $(CXXFLAGS) -I..\mesa
     23CFLAGS      = -I..\mesa\GL -I..\glu $(CFLAGS_WIN32APP) -I..\mesa
     24CXXFLAGS    = -I..\mesa\GL -I..\glu $(CXXFLAGS_WIN32APP) -I..\mesa
    2525
    2626
  • trunk/src/opengl/glut/glut_bitmap.c

    r2689 r3083  
    1 /* $Id: glut_bitmap.c,v 1.2 2000-02-09 08:46:08 jeroen Exp $ */
     1/* $Id: glut_bitmap.c,v 1.3 2000-03-11 15:07:44 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994. */
    33
     
    55   and is provided without guarantee or warrantee expressed or
    66   implied. This program is -not- in the public domain. */
    7 
    8 #include <os2win.h>
    97
    108#include "glutint.h"
  • trunk/src/opengl/glut/glut_cursor.c

    r2689 r3083  
    1 /* $Id: glut_cursor.c,v 1.2 2000-02-09 08:46:08 jeroen Exp $ */
     1/* $Id: glut_cursor.c,v 1.3 2000-03-11 15:07:44 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1995, 1998. */
    33
     
    147147        xcursor =
    148148          cursorTable[0].cursor =
    149 #if defined(__WIN32OS2__)
    150           LoadCursorA(NULL, cursorTable[0].glyph);
    151 #else
    152149          LoadCursor(NULL, cursorTable[0].glyph);
    153 #endif
    154150      }
    155151#else
     
    168164      break;
    169165    case GLUT_CURSOR_FULL_CROSSHAIR:
    170 #if defined(_WIN32)
     166#if defined(_WIN32) || defined(__WIN32OS2__)
    171167      xcursor = IDC_CROSS;
    172 #else
    173 #if defined(__WIN32OS2__)
    174       xcursor = (unsigned long)IDC_CROSSA;
    175168#else
    176169      if (fullCrosshairCusor == None) {
     
    178171      }
    179172      xcursor = fullCrosshairCusor;
    180 #endif
    181173#endif
    182174      break;
  • trunk/src/opengl/glut/glut_dials.c

    r2689 r3083  
    1 /* $Id: glut_dials.c,v 1.2 2000-02-09 08:46:09 jeroen Exp $ */
     1/* $Id: glut_dials.c,v 1.3 2000-03-11 15:07:44 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994. */
    33
     
    88#include "glutint.h"
    99
    10 void APIENTRY
     10void GLAPIENTRY
    1111glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc)
    1212{
     
    1717}
    1818
    19 void APIENTRY
     19void GLAPIENTRY
    2020glutDialsFunc(GLUTdialsCB dialsFunc)
    2121{
  • trunk/src/opengl/glut/glut_event.c

    r3080 r3083  
    1 /* $Id: glut_event.c,v 1.7 2000-03-11 09:07:12 jeroen Exp $ */
     1/* $Id: glut_event.c,v 1.8 2000-03-11 15:07:44 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1997, 1998. */
    33
     
    325325    MSG event;
    326326
    327 #if defined(__WIN32OS2__)
    328     if(!GetMessageA(&event, NULL, 0, 0))        /* bail if no more messages*/
    329 #else
    330327    if(!GetMessage(&event, NULL, 0, 0))         /* bail if no more messages*/
    331 #endif
    332328      exit(0);
    333329    TranslateMessage(&event);             /* translate virtual-key messages*/
    334 #if defined(__WIN32OS2__)
    335     DispatchMessageA(&event);                       /* call the window proc*/
    336 #else
    337330    DispatchMessage(&event);                        /* call the window proc*/
    338 #endif
    339331    /* see win32_event.c for event (message) processing procedures */
    340332#else
  • trunk/src/opengl/glut/glut_gamemode.c

    r2689 r3083  
    1 /* $Id: glut_gamemode.c,v 1.2 2000-02-09 08:46:11 jeroen Exp $ */
     1/* $Id: glut_gamemode.c,v 1.3 2000-03-11 15:07:44 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1998. */
    33
     
    1111#include <string.h>
    1212
    13 #ifdef _WIN32
     13#if defined(_WIN32) || defined(__WIN32OS2__)
    1414#include <windows.h>
    15 #endif
    16 
    17 #ifdef __WIN32OS2__
    18 #include <os2win.h>
    1915#endif
    2016
  • trunk/src/opengl/glut/glut_init.c

    r2996 r3083  
    1 /* $Id: glut_init.c,v 1.3 2000-03-04 19:10:15 jeroen Exp $ */
     1/* $Id: glut_init.c,v 1.4 2000-03-11 15:07:45 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
    33
     
    1717#if defined(__WIN32OS2__)
    1818#include <windows.h>
    19 #include "winconst.h"
    2019#include "GL\gl.h"
    2120#undef WH_NB_HOOKS /* Get rid of copiler warning... */
     
    6968{
    7069  static char *classname;
    71 #if defined(__WIN32OS2__)
    72   WNDCLASSA wc;
    73   HINSTANCE hInstance = GetModuleHandleA(NULL);
    74 #else
    7570  WNDCLASS  wc;
    7671  HINSTANCE hInstance = GetModuleHandle(NULL);
    77 #endif
    7872
    7973  /* Make sure we register the window only once. */
     
    9589
    9690  /* Clear (important!) and then fill in the window class structure. */
    97 #if defined(__WIN32OS2__)
    98   memset(&wc, 0, sizeof(WNDCLASSA));
    99   wc.hIcon         = LoadIconA(hInstance, "GLUT_ICON");
    100   wc.hCursor       = LoadCursorA(hInstance, IDC_ARROWA);
    101 #else
    10291  memset(&wc, 0, sizeof(WNDCLASS));
    10392  wc.hIcon         = LoadIcon(hInstance, "GLUT_ICON");
    10493  wc.hCursor       = LoadCursor(hInstance, IDC_ARROW);
    105 #endif
    10694
    10795  wc.lpfnWndProc   = (WNDPROC)__glutWindowProc;
     
    114102  /* Fill in a default icon if one isn't specified as a resource. */
    115103  if(!wc.hIcon)
    116 #if defined(__WIN32OS2__)
    117     wc.hIcon = LoadIconA(NULL, MAKEINTRESOURCEA(IDI_WINLOGO_W));
    118 #else
    119104    wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
    120 #endif
    121 
    122 #if defined(__WIN32OS2__)
    123   if(!RegisterClassA(&wc)) {
    124 #else
     105
    125106  if(!RegisterClass(&wc)) {
    126 #endif
    127107    __glutFatalError("RegisterClass() failed:"
    128108                     "Cannot register GLUT window class.");
     
    198178}
    199179
    200 void APIENTRY
     180void GLAPIENTRY
    201181glutInit(int *argcp, char **argv)
    202182{
    203   dprintf(("GLUT32: glutInit()\n"));
    204 
    205183  char *display = NULL;
    206184  char *str, *geometry = NULL;
     
    346324
    347325/* CENTRY */
    348 void APIENTRY
     326void GLAPIENTRY
    349327glutInitWindowPosition(int x, int y)
    350328{
     
    360338}
    361339
    362 void APIENTRY
     340void GLAPIENTRY
    363341glutInitWindowSize(int width, int height)
    364342{
     
    374352}
    375353
    376 void APIENTRY
     354void GLAPIENTRY
    377355glutInitDisplayMode(unsigned int mask)
    378356{
  • trunk/src/opengl/glut/glut_term.c

    r3079 r3083  
    1 /* $Id: glut_term.c,v 1.3 2000-03-11 09:05:05 jeroen Exp $ */
     1/* $Id: glut_term.c,v 1.4 2000-03-11 15:07:45 sandervl Exp $ */
    22/*
    33 * GLUT Termination - on exit cleanup any open windows
     
    55*/
    66
    7 #include <odinwrap.h>
    87#include "glut.h"
    98#include "glu.h"
    109#include "glutint.h"
    11 
     10#ifdef __WIN32OS2__
     11#include <misc.h>
     12#endif
    1213
    1314void CDECL Glut32Terminate(void)
    1415{
     16 int i;
     17
    1518      /* Our app has ended - close all the open windows! */
    1619      dprintf(("GLUT internal cleanup - numwins %d\n",__glutWindowListSize));
    1720
    18       for (int i = 0; i < __glutWindowListSize; i++) {
     21      for (i = 0; i < __glutWindowListSize; i++) {
    1922        if (__glutWindowList[i])
    2023          {
  • trunk/src/opengl/glut/glut_util.c

    r2689 r3083  
    1 /* $Id: glut_util.c,v 1.2 2000-02-09 08:46:19 jeroen Exp $ */
     1/* $Id: glut_util.c,v 1.3 2000-03-11 15:07:45 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994. */
    33
     
    3737
    3838#if defined(__WIN32OS2__)
    39   dprintf(("GLUT32: Warning %s: \n",
     39{
     40  char errmsg[1024];
    4041
    41     __glutProgramName ? __glutProgramName : "(unamed)"));
    42   CHAR errmsg[1024];
     42  dprintf(("GLUT32: Warning %s: \n",  __glutProgramName ? __glutProgramName : "(unnamed)"));
    4343  sprintf(errmsg, format, args);
    4444  dprintf(("GLUT32: %s\n",errmsg));
     45}
    4546#endif
    4647  fprintf(stderr, "GLUT: Warning in %s: ",
     
    6970  va_start(args, format);
    7071#if defined(__WIN32OS2__)
     72{
    7173  CHAR errmsg[1024];
    7274
     
    7779
    7880  dprintf(("GLUT32: %s\n",errmsg));
     81}
    7982#endif
    8083
     
    9699
    97100#if defined(__WIN32OS2__)
     101{
     102  char errmsg[1024];
    98103  dprintf(("GLUT: Fatal API Usage in %s:\n",
    99104    __glutProgramName ? __glutProgramName : "(unamed)"));
    100   char errmsg[1024];
    101105  sprintf(errmsg, format, args);
    102106  dprintf(("GLUT32: %s",errmsg));
    103107  putc('\n', stderr);
     108}
    104109#endif
    105110
  • trunk/src/opengl/glut/glut_win.c

    r3079 r3083  
    1 /* $Id: glut_win.c,v 1.6 2000-03-11 09:05:05 jeroen Exp $ */
     1/* $Id: glut_win.c,v 1.7 2000-03-11 15:07:46 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994, 1997.  */
    33
     
    1616
    1717#include "glutint.h"
    18 
    19 //#if defined(__WIN32OS2__)
    20 //#include "wgl.h"
    21 //#endif
    2218
    2319GLUTwindow *__glutCurrentWindow = NULL;
     
    479475
    480476#if defined(_WIN32) || defined(__WIN32OS2__)
    481 #if defined(__WIN32OS2__)
    482   WNDCLASSA wc;
    483 #else
    484477  WNDCLASS wc;
    485 #endif
    486478  int style;
    487479
    488 #if defined(__WIN32OS2__)
    489   if (!GetClassInfoA(GetModuleHandleA(NULL), "GLUT", &wc)) {
    490 #else
    491480  if (!GetClassInfo(GetModuleHandle(NULL), "GLUT", &wc)) {
    492 #endif
    493481    __glutOpenWin32Connection(NULL);
    494482  }
     
    556544    }
    557545  }
    558 #if defined(__WIN32OS2__)
    559   window->win = CreateWindowA("GLUT", "GLUT",
    560     WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style,
    561     x, y, width, height, parent ? parent->win : __glutRoot,
    562     NULL, GetModuleHandleA(NULL), 0);
    563 #else
    564546  window->win = CreateWindow("GLUT", "GLUT",
    565547    WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style,
    566548    x, y, width, height, parent ? parent->win : __glutRoot,
    567549    NULL, GetModuleHandle(NULL), 0);
    568 #endif
    569550
    570551  window->hdc = GetDC(window->win);
     
    587568  /* Make sure subwindows get a windowStatus callback. */
    588569  if (parent) {
    589 #if defined(__WIN32OS2__)
    590     PostMessageA(parent->win, WM_ACTIVATE, 0, 0);
    591 #else
    592570    PostMessage(parent->win, WM_ACTIVATE, 0, 0);
    593 #endif
    594571  }
    595572  window->renderDc = window->hdc;
     
    743720  textprop.nitems = strlen(title);
    744721#if defined(_WIN32) || defined(__WIN32OS2__)
    745 #if defined(__WIN32OS2__)
    746   SetWindowTextA(win, title);
    747 #else
    748722  SetWindowText(win, title);
    749 #endif
    750723  if (__glutIconic) {
    751724    window->desiredMapState = IconicState;
  • trunk/src/opengl/glut/glutint.h

    r3079 r3083  
    1 /* $Id: glutint.h,v 1.5 2000-03-11 09:05:05 jeroen Exp $ */
     1/* $Id: glutint.h,v 1.6 2000-03-11 15:07:47 sandervl Exp $ */
    22#ifndef __glutint_h__
    33#define __glutint_h__
     
    235235
    236236typedef struct _DisplayMode {
    237 #if defined(_WIN32)
     237#if defined(_WIN32) || defined(__WIN32OS2__)
    238238  DEVMODE devmode;
    239 #else
    240 #if defined(__WIN32OS2__)
    241   DEVMODEA devmode;
    242239#else
    243240  /* XXX The X Window System does not have a standard
     
    246243     control extension).  Perhaps this can be done in
    247244     a future release of GLUT. */
    248 #endif
    249245#endif
    250246  int valid;
  • trunk/src/opengl/glut/glutos2.h

    r2689 r3083  
    1 /* $Id: glutos2.h,v 1.2 2000-02-09 08:46:20 jeroen Exp $ */
     1/* $Id: glutos2.h,v 1.3 2000-03-11 15:07:47 sandervl Exp $ */
    22#ifndef __glutos2_h__
    33#define __glutos2_h__
     
    1111#include "os2_x11.h"
    1212#include "os2_glx.h"
     13#include <misc.h>
     14#include <sys\time.h>
    1315
    1416/* We have to undef some things because Microsoft likes to pollute the
  • trunk/src/opengl/glut/os2_glx.h

    r2689 r3083  
    1 /* $Id: os2_glx.h,v 1.2 2000-02-09 08:46:21 jeroen Exp $ */
     1/* $Id: os2_glx.h,v 1.3 2000-03-11 15:07:47 sandervl Exp $ */
    22#ifndef __os2_glx_h__
    33#define __os2_glx_h__
     
    1414
    1515/* Type definitions (conversions). */
    16 typedef ULONG HGLRC;
    1716typedef HGLRC GLXContext;
    1817
  • trunk/src/opengl/glut/os2_x11.h

    r2689 r3083  
    1 /* $Id: os2_x11.h,v 1.2 2000-02-09 08:46:21 jeroen Exp $ */
     1/* $Id: os2_x11.h,v 1.3 2000-03-11 15:07:47 sandervl Exp $ */
    22#ifndef __os2_x11_h__
    33#define __os2_x11_h__
     
    1212
    1313#include <stdlib.h>
    14 #include <os2win.h>
     14#include <windows.h>
    1515
    1616/* Type definitions (conversions) */
  • trunk/src/opengl/glut/win32_menu.c

    r3079 r3083  
    1 /* $Id: win32_menu.c,v 1.4 2000-03-11 09:05:05 jeroen Exp $ */
     1/* $Id: win32_menu.c,v 1.5 2000-03-11 15:07:48 sandervl Exp $ */
    22/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */
    33/* Copyright (c) Nate Robins, 1997. */
     
    3030
    3131/* DEPRICATED, use glutMenuStatusFunc instead. */
    32 void APIENTRY
     32void GLAPIENTRY
    3333glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
    3434{
     
    3636}
    3737
    38 void APIENTRY
     38void GLAPIENTRY
    3939glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
    4040{
     
    233233}
    234234
    235 int APIENTRY
     235int GLAPIENTRY
    236236glutCreateMenu(GLUTselectCB selectFunc)
    237237{
     
    261261}
    262262
    263 void APIENTRY
     263void GLAPIENTRY
    264264glutDestroyMenu(int menunum)
    265265{
     
    288288}
    289289
    290 int APIENTRY
     290int GLAPIENTRY
    291291glutGetMenu(void)
    292292{
     
    298298}
    299299
    300 void APIENTRY
     300void GLAPIENTRY
    301301glutSetMenu(int menuid)
    302302{
     
    330330  item->value = value;
    331331  item->unique = uniqueMenuHandler++;
    332 #if defined(__WIN32OS2__)
    333   if (isTrigger) {
    334     AppendMenuA(menu->win, MF_POPUP, (UINT)item->win, label);
    335   } else {
    336     AppendMenuA(menu->win, MF_STRING, item->unique, label);
    337   }
    338 #else
    339332  if (isTrigger) {
    340333    AppendMenu(menu->win, MF_POPUP, (UINT)item->win, label);
     
    342335    AppendMenu(menu->win, MF_STRING, item->unique, label);
    343336  }
    344 #endif
    345 }
    346 
    347 void APIENTRY
     337}
     338
     339void GLAPIENTRY
    348340glutAddMenuEntry(const char *label, int value)
    349341{
     
    364356}
    365357
    366 void APIENTRY
     358void GLAPIENTRY
    367359glutAddSubMenu(const char *label, int menu)
    368360{
     
    389381}
    390382
    391 void APIENTRY
     383void GLAPIENTRY
    392384glutChangeToMenuEntry(int num, const char *label, int value)
    393385{
     
    418410      item->value = value;
    419411      item->unique = uniqueMenuHandler++;
    420 #if defined(__WIN32OS2__)
    421       ModifyMenuA(__glutCurrentMenu->win, (UINT) i - 1,
    422         MF_BYPOSITION | MFT_STRING, item->unique, label);
    423 #else
    424412      ModifyMenu(__glutCurrentMenu->win, (UINT) i - 1,
    425413        MF_BYPOSITION | MFT_STRING, item->unique, label);
    426 #endif
    427414      return;
    428415    }
     
    433420}
    434421
    435 void APIENTRY
     422void GLAPIENTRY
    436423glutChangeToSubMenu(int num, const char *label, int menu)
    437424{
     
    465452      if (popupmenu)
    466453        item->win = popupmenu->win;
    467 #if defined(__WIN32OS2__)
    468       ModifyMenuA(__glutCurrentMenu->win, (UINT) i - 1,
    469         MF_BYPOSITION | MF_POPUP, (UINT) item->win, label);
    470 #else
    471454      ModifyMenu(__glutCurrentMenu->win, (UINT) i - 1,
    472455        MF_BYPOSITION | MF_POPUP, (UINT) item->win, label);
    473 #endif
    474456      return;
    475457    }
     
    480462}
    481463
    482 void APIENTRY
     464void GLAPIENTRY
    483465glutRemoveMenuItem(int num)
    484466{
     
    513495}
    514496
    515 void APIENTRY
     497void GLAPIENTRY
    516498glutAttachMenu(int button)
    517499{
     
    529511}
    530512
    531 void APIENTRY
     513void GLAPIENTRY
    532514glutDetachMenu(int button)
    533515{
  • trunk/src/opengl/glut/win32_winproc.c

    r3022 r3083  
    1 /* $Id: win32_winproc.c,v 1.4 2000-03-05 10:19:39 jeroen Exp $ */
     1/* $Id: win32_winproc.c,v 1.5 2000-03-11 15:07:48 sandervl Exp $ */
    22/* Copyright (c) Nate Robins, 1997. */
    33/* portions Copyright (c) Mark Kilgard, 1997, 1998. */
     
    1919#endif
    2020
    21 #ifdef _WIN32
     21#if defined(_WIN32) || defined(__WIN32OS2__)
    2222#include <mmsystem.h>  /* Win32 Multimedia API header. */
    2323#endif
     
    163163      default:
    164164        if (window->keyboardUp) {
    165 #if defined(__WIN32OS2__)
    166           key = MapVirtualKeyA(wParam, 2);                 /* Map to ASCII.*/
    167 #else
    168165          key = MapVirtualKey(wParam, 2);                  /* Map to ASCII.*/
    169 #endif
    170166          if (isascii(key) && (key != 0)) {
    171167
     
    705701    /* Make sure we re-select the correct palette if needed. */
    706702    if (LOWORD(wParam)) {
    707 #if defined(__WIN32OS2__)
    708       PostMessageA(hwnd, WM_PALETTECHANGED, 0, 0);
    709 #else
    710703      PostMessage(hwnd, WM_PALETTECHANGED, 0, 0);
    711 #endif
    712704    }
    713705    if (window) {
     
    839831
    840832defproc:
    841 #if defined(__WIN32OS2__)
    842   return DefWindowProcA(hwnd, msg, wParam, lParam);
    843 #else
    844833  return DefWindowProc(hwnd, msg, wParam, lParam);
    845 #endif
    846834}
  • trunk/src/opengl/glut/win32_x11.c

    r2689 r3083  
    1 /* $Id: win32_x11.c,v 1.2 2000-02-09 08:46:23 jeroen Exp $ */
     1/* $Id: win32_x11.c,v 1.3 2000-03-11 15:07:48 sandervl Exp $ */
    22/* Copyright (c) Nate Robins, 1997. */
    33/* portions Copyright (c) Mark Kilgard, 1998. */
     
    265265  MSG msg;
    266266
    267 #if defined(__WIN32OS2__)
    268   return PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE);
    269 #else
    270267  return PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
    271 #endif
    272268}
    273269
Note: See TracChangeset for help on using the changeset viewer.