GLXWorkstation.st
changeset 2422 6bffcb4c8360
parent 2075 7fc93b8da816
child 2449 5fdfb68d0bcc
equal deleted inserted replaced
2421:037f43af3b0e 2422:6bffcb4c8360
    64 #define Object GLX_Object
    64 #define Object GLX_Object
    65 
    65 
    66 #undef True
    66 #undef True
    67 #undef False
    67 #undef False
    68 
    68 
       
    69 #if defined(__openVMS__) || defined(LINUX)
       
    70   /*
       
    71    * mhmh - used in stdio ...
       
    72    * (new linuxes)
       
    73    */
       
    74 # undef __new
       
    75 # define __NEED_REDEF_new__
       
    76 #endif
       
    77 
    69 #ifdef __VMS__
    78 #ifdef __VMS__
    70 # undef __new
       
    71 # include "vms_Xnames.h"
    79 # include "vms_Xnames.h"
    72 #endif
    80 #endif
    73 
    81 
    74 #include <stdio.h>
    82 #include <stdio.h>
    75 
    83 
   113 # include <X11/extensions/SGIStereo.h>
   121 # include <X11/extensions/SGIStereo.h>
   114 #endif
   122 #endif
   115 
   123 
   116 #ifndef NULL
   124 #ifndef NULL
   117 # define NULL (char *)0         /* sigh */
   125 # define NULL (char *)0         /* sigh */
       
   126 #endif
       
   127 
       
   128 #ifdef __NEED_REDEF_new__
       
   129 # define __new  __STX___new
   118 #endif
   130 #endif
   119 
   131 
   120 typedef enum {
   132 typedef enum {
   121     GLXcolorIndexSingleBuffer,
   133     GLXcolorIndexSingleBuffer,
   122     GLXcolorIndexDoubleBuffer,
   134     GLXcolorIndexDoubleBuffer,
  6593 %}
  6605 %}
  6594 .
  6606 .
  6595     ^ false
  6607     ^ false
  6596 !
  6608 !
  6597 
  6609 
  6598 glxLsetdepthNear: near far: far in: aGLXWindowId
  6610 glxLsetdepthNear:znear far:zfar in: aGLXWindowId
  6599 
  6611 
  6600 %{  /* NOCONTEXT */
  6612 %{  /* NOCONTEXT */
  6601 #ifdef GLX
  6613 #ifdef GLX
  6602     SETWIN(aGLXWindowId)
  6614     SETWIN(aGLXWindowId)
  6603     lsetdepth(_longVal(near), _longVal(far));
  6615     lsetdepth(_longVal(znear), _longVal(zfar));
  6604     RETURN (true);
  6616     RETURN (true);
  6605 #endif
  6617 #endif
  6606 %}
  6618 %}
  6607 .
  6619 .
  6608     ^ false
  6620     ^ false
  7398 %}
  7410 %}
  7399 .
  7411 .
  7400     ^ false
  7412     ^ false
  7401 !
  7413 !
  7402 
  7414 
  7403 glxSetdepthNear: near far: far in: aGLXWindowId
  7415 glxSetdepthNear:znear far:zfar in: aGLXWindowId
  7404 
  7416 
  7405 %{  /* NOCONTEXT */
  7417 %{  /* NOCONTEXT */
  7406 #ifdef GLX
  7418 #ifdef GLX
  7407     SETWIN(aGLXWindowId)
  7419     SETWIN(aGLXWindowId)
  7408     setdepth(_screencoordVal(near), _screencoordVal(far));
  7420     setdepth(_screencoordVal(znear), _screencoordVal(zfar));
  7409     RETURN (true);
  7421     RETURN (true);
  7410 #endif
  7422 #endif
  7411 %}
  7423 %}
  7412 .
  7424 .
  7413     ^ false
  7425     ^ false
  8344     ortho2(f_left, f_right, f_bottom, f_top);
  8356     ortho2(f_left, f_right, f_bottom, f_top);
  8345 #endif
  8357 #endif
  8346 %}
  8358 %}
  8347 !
  8359 !
  8348 
  8360 
  8349 glxOrthoLeft: left right: right bottom: bottom top: top near: near far: far in: aGLXWindowId
  8361 glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId
  8350     "define orthogonal projection"
  8362     "define orthogonal projection"
  8351 
  8363 
  8352 %{  /* NOCONTEXT */
  8364 %{  /* NOCONTEXT */
  8353     float f_left, f_right, f_bottom, f_top,
  8365     float f_left, f_right, f_bottom, f_top,
  8354 	  f_near, f_far;
  8366 	  f_near, f_far;
  8355 
  8367 
  8356     _FLOAT_(left, f_left)
  8368     _FLOAT_(left, f_left)
  8357     _FLOAT_(right, f_right)
  8369     _FLOAT_(right, f_right)
  8358     _FLOAT_(bottom, f_bottom)
  8370     _FLOAT_(bottom, f_bottom)
  8359     _FLOAT_(top, f_top)
  8371     _FLOAT_(top, f_top)
  8360     _FLOAT_(near, f_near)
  8372     _FLOAT_(znear, f_near)
  8361     _FLOAT_(far, f_far)
  8373     _FLOAT_(zfar, f_far)
  8362     SETWIN(aGLXWindowId)
  8374     SETWIN(aGLXWindowId)
  8363 #ifdef OPENGL
  8375 #ifdef OPENGL
  8364 #else
  8376 #else
  8365     ortho(f_left, f_right, f_bottom, f_top, f_near, f_far);
  8377     ortho(f_left, f_right, f_bottom, f_top, f_near, f_far);
  8366 #endif
  8378 #endif
  8367 %}
  8379 %}
  8368 !
  8380 !
  8369 
  8381 
  8370 glxPerspectiveFovy:fovy aspect:aspect near:near far:far in:aGLXWindowId
  8382 glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId
  8371     "define perspective projection"
  8383     "define perspective projection"
  8372 
  8384 
  8373 %{  /* NOCONTEXT */
  8385 %{  /* NOCONTEXT */
  8374 
  8386 
  8375     Angle a_fovy;
  8387     Angle a_fovy;
  8376     Coord c_near, c_far;
  8388     Coord c_near, c_far;
  8377     float f_aspect;
  8389     float f_aspect;
  8378 
  8390 
  8379     _ANGLE_ (fovy, a_fovy)
  8391     _ANGLE_ (fovy, a_fovy)
  8380     _FLOAT_ (aspect, f_aspect)
  8392     _FLOAT_ (aspect, f_aspect)
  8381     _COORD_ (near, c_near)
  8393     _COORD_ (znear, c_near)
  8382     _COORD_ (far, c_far)
  8394     _COORD_ (zfar, c_far)
  8383 
  8395 
  8384     SETWIN(aGLXWindowId)
  8396     SETWIN(aGLXWindowId)
  8385 #ifdef OPENGL
  8397 #ifdef OPENGL
  8386 #else
  8398 #else
  8387     perspective(a_fovy, f_aspect, c_near, c_far);
  8399     perspective(a_fovy, f_aspect, c_near, c_far);
  8456 	     _screencoordVal(bottom), _screencoordVal(top));
  8468 	     _screencoordVal(bottom), _screencoordVal(top));
  8457 #endif
  8469 #endif
  8458 %}
  8470 %}
  8459 !
  8471 !
  8460 
  8472 
  8461 glxWindowLeft: left right: right bottom: bottom top: top near: near far: far in: aGLXWindowId
  8473 glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId
  8462     "this one was added independently by JEFF - kept for his programs ..."
  8474     "this one was added independently by JEFF - kept for his programs ..."
  8463 
  8475 
  8464     self glxWindowLeft:left right:right top:top bottom:bottom near:near far:far in:aGLXWindowId
  8476     self glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId
  8465 !
  8477 !
  8466 
  8478 
  8467 glxWindowLeft:left right:right top:top bottom:bottom near:near far:far in:aGLXWindowId
  8479 glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId
  8468     "define perspective viewing pyramid"
  8480     "define perspective viewing pyramid"
  8469 
  8481 
  8470 %{  /* NOCONTEXT */
  8482 %{  /* NOCONTEXT */
  8471     Coord c_left, c_right, c_top, c_bot, c_near, c_far;
  8483     Coord c_left, c_right, c_top, c_bot, c_near, c_far;
  8472 
  8484 
  8473     _COORD_ (left, c_left)
  8485     _COORD_ (left, c_left)
  8474     _COORD_ (right, c_right)
  8486     _COORD_ (right, c_right)
  8475     _COORD_ (top, c_top)
  8487     _COORD_ (top, c_top)
  8476     _COORD_ (bottom, c_bot)
  8488     _COORD_ (bottom, c_bot)
  8477     _COORD_ (near, c_near)
  8489     _COORD_ (znear, c_near)
  8478     _COORD_ (far, c_far)
  8490     _COORD_ (zfar, c_far)
  8479     SETWIN(aGLXWindowId)
  8491     SETWIN(aGLXWindowId)
  8480 #ifdef OPENGL
  8492 #ifdef OPENGL
  8481 #else
  8493 #else
  8482     window(c_left, c_right, c_bot, c_top, c_near, c_far);
  8494     window(c_left, c_right, c_bot, c_top, c_near, c_far);
  8483 #endif
  8495 #endif
  8791 ! !
  8803 ! !
  8792 
  8804 
  8793 !GLXWorkstation class methodsFor:'documentation'!
  8805 !GLXWorkstation class methodsFor:'documentation'!
  8794 
  8806 
  8795 version
  8807 version
  8796     ^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.72 1998-03-05 19:47:27 cg Exp $'
  8808     ^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.73 1999-01-15 21:33:19 cg Exp $'
  8797 ! !
  8809 ! !