Help making a game with transparency

Murilo murilomiranda92 at hotmail.com
Mon Sep 30 23:52:27 UTC 2019


Hi everyone, I tried creating a program which simply shows the 
image of the ship near the corner of the screen, just for testing 
sake. Here it is:

import arsd.gamehelpers, arsd.image;
​
void main()​
{​
     SimpleWindow window = create2dWindow("Space Invaders", 1000, 
400);​
     OpenGlTexture ship = new 
OpenGlTexture(loadImageFromFile("images/ship_normal.png").getAsTrueColorImage());​
     window.eventLoop(40,​
     (/*no events*/)​
     {​
         window.redrawOpenGlSceneNow;​
         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | 
GL_ACCUM_BUFFER_BIT);​
         glLoadIdentity;​
         ship.draw(20, 20, 41, 47);​
     });​
}​

But the screen stays all white, nothing appears in it. Any ideas 
what needs to be changed?


More information about the Digitalmars-d-learn mailing list