Changeset 29:2e9b106ed4b1

Show
Ignore:
Timestamp:
03/03/08 19:25:40 (4 years ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

moved OpenGl? example into dwtsnippets folder and made it only build if -version=Derelict is set.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dsss.conf

    r27 r29  
    4747[user/torhu_synctest.d] 
    4848 
    49 [snippets/opengl_test1.d] 
    50 prebuild=warn Derelict must be installed 
     49version(Derelict){ 
     50[dwtsnippets/opengl/Snippet195.d] 
     51
    5152 
    5253[dwtexamples/addressbook/AddressBook.d] 
  • dwtsnippets/opengl/Snippet195.d

    r9 r29  
    1212 *******************************************************************************/ 
    1313 
    14 module opengl_test1
     14module dwtsnippets.opengl.Snippet195
    1515 
    1616/* 
     
    1919 * For a list of all SWT example snippets see 
    2020 * http://www.eclipse.org/swt/snippets/ 
    21  *  
     21 * 
    2222 * @since 3.2 
    2323 */ 
    24   
     24 
    2525import dwt.DWT; 
    2626import dwt.dwthelper.Runnable; 
     
    4141import Math = tango.math.Math; 
    4242 
    43 void drawTorus(float r, float R, int nsides, int rings)  
     43void drawTorus(float r, float R, int nsides, int rings) 
    4444{ 
    4545    float ringDelta = 2.0f * cast(float) Math.PI / rings; 
     
    6969} 
    7070 
    71 void main()  
     71void main() 
    7272{ 
    7373    DerelictGL.load(); 
    7474    DerelictGLU.load(); 
    75      
     75 
    7676    Display display = new Display(); 
    7777    Shell shell = new Shell(display); 
     
    8989            Rectangle bounds = canvas.getBounds(); 
    9090            float fAspect = cast(float) bounds.width / cast(float) bounds.height; 
    91   
     91 
    9292            glViewport(0, 0, bounds.width, bounds.height); 
    9393            glMatrixMode(GL_PROJECTION); 
     
    115115            if (!canvas.isDisposed()) { 
    116116                canvas.setCurrent(); 
    117      
     117 
    118118                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    119119                glClearColor(.3f, .5f, .8f, 1.0f);