createimage / code consistency usewindow usesprite etc.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

createimage / code consistency usewindow usesprite etc.

Post by blueznl »

perhaps a good suggestion would be to make the commands for 2d output consistent...

UseImage
UseSprite
UseTexture

WindowOutput( [ window_id ] )
SpriteOutput( [ sprite_id ] )

etc.

Code: Select all


    Windows

      UseWindow( window_id )
      StartDrawing( WindowOutput() )
      ..
      StopDrawing


    Images.

    As for windows.

      UseImage( image_id )
      StartDrawing( ImageOutput() )
      ..
      StopDrawing


    Sprites.

    Multiple sprites are possible. The syntax however is slightly different from using windows.

      StartDrawing( SpriteOutput( sprite_id ) )
      ..
      StopDrawing


    Screens.

    There can only be one screen, so you don't have to 'use' it.

      StartDrawing( ScreenOutput() )
      ..
      StopDrawing

Last edited by blueznl on Wed Oct 22, 2003 11:44 pm, edited 2 times in total.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

in general, there are many commands that could do without that additional 'use' statement...

UseImage(1)
d4.l=ImageDepth()

could be replaced with

d4.l=ImageDepth(1)

less llines and better readable, and might result in quicker code... what if i don't want to use (send output to) that image, just want to have the depth?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

and, as a final note, how about CreateImage() with a depth parameter?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply