SDL and transparency

Discuss any general programming issues here

SDL and transparency

Postby Allanon » Mon Sep 18, 2017 12:45 pm

Hello,
I'm having problems drawing hardware brushes with an arbitrary transparency (on WIndows).

The drawing tag "transparency" seems to be not supported while RebelSDL is used, I've also tried to use

Code: Select all
sdl.SetTextureAlphaMod(1, 100)


Where 1 is the id of my hardware brush, but it says that the object is not found.

Any hints?
User avatar
Allanon
 
Posts: 411
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: SDL and transparency

Postby airsoftsoftwair » Mon Sep 18, 2017 7:55 pm

The "Transparency" tag of @BRUSH and LoadBrush() works here with RebelSDL. Please post a code snippet if it doesn't work you and I'll take a look.

sdl.SetTextureAlphaMod() and all other RebelSDL commands which expect an identifier of a hardware brush require Hollywood 7.1, unfortunately :)
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: SDL and transparency

Postby Allanon » Tue Sep 19, 2017 8:50 am

Hi Andreas,

here a screenshot running on Windows 10 :
Image

and here is the snippet:
Code: Select all
; TESTING DRAWING TAGS & SDL
; --------------------------------------------------------------
@REQUIRE "rebelsdl"

LoadBrush(1, "test.png",
          { Hardware = True, Display = 1, LoadAlpha = True })
                   
                   
Local tags =
  { ; Width = 300, Height = 300,
    ; ScaleX = 0.5, ScaleY = 0.5,
    ; Rotate = 125,ù
    ; Transform = { 1, 0.5, 0, 0.5 },
    ; SmoothScale = True,
    ; AnchorX = 0.5, AnchorY = 0.5,
    Transparency = 100
    ; Tint = 100,
    ; TintColor = #RED,
    }
   
BeginDoubleBuffer(True)

Repeat
  Cls(#RED)
  DisplayBrush(1, #CENTER, #CENTER, tags)
  Flip()
Forever


For the sdl commands, ok, I will update HW in the next weeks ;)
User avatar
Allanon
 
Posts: 411
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: SDL and transparency

Postby airsoftsoftwair » Thu Sep 21, 2017 6:32 pm

Sorry, I misread your original post. Indeed, the "Transparency" tag in DisplayBrush() et al. isn't supported by RebelSDL and GL Galore because the Hollywood SDK doesn't support this. Would be a nice addition though but before this is possible the SDK will need a new interface that supports it.
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: SDL and transparency

Postby Allanon » Thu Sep 21, 2017 7:25 pm

:cry:
User avatar
Allanon
 
Posts: 411
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy

Re: SDL and transparency

Postby airsoftsoftwair » Thu Sep 21, 2017 9:20 pm

As a workaround, you can use sdl.SetTextureAlphaMod(), though. But it needs Hollywood 7.1...
User avatar
airsoftsoftwair
 
Posts: 2233
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: SDL and transparency

Postby Allanon » Fri Sep 22, 2017 4:22 pm

Well, I've planned to switch to Hollywood 7.1 so it's good to hear that :)
User avatar
Allanon
 
Posts: 411
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy


Return to General programming

Who is online

Users browsing this forum: No registered users and 3 guests