[Implemented] Nativ DirectX7 should be a Subsystem too

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

[Implemented] Nativ DirectX7 should be a Subsystem too

Post by IceSoft »

How can I detect with compilerif thats I use currently the DirectX7 sprite lib?

I cannot...so I hope the DirectX7 will be also a Subsystem (The default one).
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 345
Joined: Sat Dec 25, 2004 2:37 pm

Re: [PB4.20b1] Nativ DirectX7 should be a Subsystem too

Post by thyphoon »

IceSoft wrote:How can I detect with compilerif thats I use currently the DirectX7 sprite lib?

I cannot...so I hope the DirectX7 will be also a Subsystem (The default one).
if no subsystem used :

Code: Select all

CompilerIf SubSystem("")
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: [PB4.20b1] Nativ DirectX7 should be a Subsystem too

Post by IceSoft »

thyphoon wrote:if no subsystem used :

Code: Select all

CompilerIf SubSystem("")
Ok fine.
As long as there are only 'Graphic' Subssystems existing as long I can use this piece of code. Thanks.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

Code: Select all

CompilerIf SubSystem("")
This is not working. Sorry. We need a solution from Fantasie Software for this.

Try and change the subsystem:

Code: Select all

Debug SubSystem("")
There are no differents I got always: 0
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

Image

Code: Select all

CompilerIf Subsystem("DirectX9")
  MessageRequester("", "DirectX 9")
CompilerElse
  MessageRequester("", "DirectX 7")
CompilerEndIf
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

nco2k wrote:Image

Code: Select all

CompilerIf Subsystem("DirectX9")
  MessageRequester("", "DirectX 9")
CompilerElse
  MessageRequester("", "DirectX 7")
CompilerEndIf
c ya,
nco2k
What about DX9: I have currently 3 Subsystems:
the native DirectX7
the 4.20 DirectX9
the S.M. DX9

And do not forget the currently not working OpenGL subsystem!

So we need a new compiler directive: CompilerElseIf
Last edited by IceSoft on Fri Jan 04, 2008 7:30 pm, edited 1 time in total.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

Makes me think... is there a CompilerElseIf these days?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

What about using CompilerCase for that?
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

traumatic wrote:What about using CompilerCase for that?

Code: Select all

CompilerSelect <numeric constant>
  CompilerCase
    ...
  [CompilerDefault]
    ...
CompilerEndSelect
is not usefull in this case.
You can only get an info about a subsystem like using or not using...not of which one is used.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

IceSoft wrote:You can only get an info about a subsystem like using or not using...not of which one is used.
True. Sorry, I thought into the wrong direction.
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

traumatic wrote:
IceSoft wrote:You can only get an info about a subsystem like using or not using...not of which one is used.
... I thought into the wrong direction.
No prob... I doing it all the time. :wink:
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

i agree on the missing CompilerElseIf, but stop saying xyz is not possible, because it is... :?

Code: Select all

CompilerIf Subsystem("DirectX9")
  MessageRequester("", "DirectX9")
CompilerElse
  CompilerIf Subsystem("DX9")
    MessageRequester("", "DX9")
  CompilerElse
    CompilerIf Subsystem("OpenGL")
      MessageRequester("", "OpenGL")
    CompilerElse
      MessageRequester("", "DirectX7")
    CompilerEndIf
  CompilerEndIf
CompilerEndIf
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

nco2k wrote:i agree on the missing CompilerElseIf, but stop saying xyz is not possible, because it is... :?

Code: Select all

CompilerIf Subsystem("DirectX9")
  MessageRequester("", "DirectX9")
CompilerElse
  CompilerIf Subsystem("DX9")
    MessageRequester("", "DX9")
  CompilerElse
    CompilerIf Subsystem("OpenGL")
      MessageRequester("", "OpenGL")
    CompilerElse
      MessageRequester("", "DirectX7")
    CompilerEndIf
  CompilerEndIf
CompilerEndIf
c ya,
nco2k
Please add the missing 2 new grafic subsystem which I will make with the release of PB4.20.

DX10 and SDL

If you have it done...I will say no longer it is not possible. :wink:
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

IceSoft wrote:Please add the missing 2 new grafic subsystem which I will make with the release of PB4.20.

DX10 and SDL

If you have it done...I will say no longer it is not possible. :wink:
and that is connected how to this thread? dont mix apples and oranges. :roll:

first you said its not possible to detect dx7 because its not a subsystem and i showed you otherwise. then you said its not possible to detect various subsystems because of the missing CompilerElseIf and i showed you otherwise.

you wanted a solution, you got a soultion... its that simple.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

You could have use CompilerSelect if it wasn't so buggy. I think I need to report something!

You can test the concept with constants, but unfortunately with Subsystem() inlined everything goes boom.

Code: Select all

#DX9 = Subsystem("DirectX9")
#OpenGL = Subsystem("opengl")
#SDL = Subsystem("sdl")
#DX10 = Subsystem("dx10")

CompilerSelect 1
  CompilerCase #DX9
    Debug "nine"
  CompilerCase #OpenGL
    Debug "opengl"
  CompilerCase #sdl
    Debug "sdl"
  CompilerCase #dx10
    Debug "ten!"
  CompilerDefault
    Debug "seven"
CompilerEndSelect

Post Reply