OpenWindowedScreen - Bit depth

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

OpenWindowedScreen - Bit depth

Post by dracflamloc »

Is there a way to specify to load sprite3d textures as 16 bit, and/or open the screen in 16 bit. The reason I ask is because my mmorpg after loading the tile sheet and sprite sheet, etc, takes up 40mb of video ram.

For a 2d rpg, thats pretty crazy. I could create a loader/unloader for unused tiles on a map, etc, but it'd still be nice to specify the bit depth, and maybe even some kind of in-memory texture compression for sprite3d.

Thanks.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Result = OpenScreen(Width, Height, Depth, Title$)
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

It's about OpenWindowedScreen...
...and AFAIK you can't have 2 different depths at the same time
(gamescreen vs. desktop). How should that work?
Good programmers don't comment their code. It was hard to write, should be hard to read.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I missed the Window thing.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: OpenWindowedScreen - Bit depth

Post by Fluid Byte »

dracflamloc wrote:Is there a way to specify to load sprite3d textures as 16 bit, and/or open the screen in 16 bit. The reason I ask is because my mmorpg after loading the tile sheet and sprite sheet, etc, takes up 40mb of video ram.

For a 2d rpg, thats pretty crazy. I could create a loader/unloader for unused tiles on a map, etc, but it'd still be nice to specify the bit depth, and maybe even some kind of in-memory texture compression for sprite3d.
Absolutely not because the depth of a windowed screen is always the depth of your current desktop setting. E.g. you can't set your desktop to 32Bit and your windowed screen to 16Bit because the both share the same graphical environment.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Actually it can be rendered in 16 bits and the surface itself drawn to the 32 bit screen. I've seen it done, however I have more than just that request. I want to be able to tell LoadSprite what quality and bitdepth a texture is loaded in. This should have nothing to do with what depth the screen itself is.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

dracflamloc wrote:Actually it can be rendered in 16 bits and the surface itself drawn to the 32 bit screen.
Well, not nativley in PB.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Fluid Byte wrote:
dracflamloc wrote:Actually it can be rendered in 16 bits and the surface itself drawn to the 32 bit screen.
Well, not nativley in PB.
Image Which is why he's requesting it...
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Trond wrote:
Fluid Byte wrote:
dracflamloc wrote:Actually it can be rendered in 16 bits and the surface itself drawn to the 32 bit screen.
Well, not nativley in PB.
Image Which is why he's requesting it...
Not, quite:
dracflamloc wrote:I want to be able to tell LoadSprite what quality and bitdepth a texture is loaded in. This should have nothing to do with what depth the screen itself is.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

this was kind of a 2-for-1 request, I want both to be possible =)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Fluid Byte wrote:
Trond wrote:
Fluid Byte wrote:
dracflamloc wrote:Actually it can be rendered in 16 bits and the surface itself drawn to the 32 bit screen.
Well, not nativley in PB.
Image Which is why he's requesting it...
Not, quite:
dracflamloc wrote:I want to be able to tell LoadSprite what quality and bitdepth a texture is loaded in. This should have nothing to do with what depth the screen itself is.
I don't think he said exactly what he meant. Sort of.
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

haha... ok heres a breakdown to avoid any confusion:

1. OpenWindowedScreen should be able to force a bit depth one way or another.

2. LoadSprite, Catch, etc should have an option to specify the bit depth it is loaded in as. If I want to load a 32bit PNG as 16-bit or 8-bit texture it should be possible, and would help reduce video memory usage with large tile/sprite sheets.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I asked for a selectable bitdepth for OpenWindowedScreen somewhere and Fred replied that he thought it was an interesting idea and worth doing but I can't for the life of me find the post again. It was about six months ago.
BERESHEIT
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Yo dracflamloc! Do me a favor, no more 2-for-1 request! :twisted:

One more thing. If you want a custom depth for your windowed screen you may ask/force the user to switch the depth temporary while your program is running (at least until we have another solution). Not uncommon for emulators or some older games.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

I'm wondering if that'd save on the video memory, which is my primary concern with all this. Might try and see =)
Post Reply