Hi everybody,
I would like to ask if anybody here has had a similar problem like me at the moment. At first I'd like to mention that the problems occurs on my Atom Netbook with 2GB RAM and 256MB integrated graphics. DarkBasic itsself says I have more than 50MB free video memory and more than 260MB free total memory.
The problems appears on other low graphics systems, too.
When the application starts (after I change the screen resolution) I empty the video memory using the following code:
rem *** Empty video card memory ***
flush video memory
rem *******************************
if tnl available()=1
enable tnl
else
disable tnl
endif
disable systemkeys
disable escapekey
hide mouse
sync on
sync rate WantedFrameRate
autocam off
backdrop on
color backdrop 0
After that I load different images. Some are 1024x1024 used as textures. Others are just 256x256 or 512x512.
Then I create objects like trees and stones and seagrass and so on using meshes.
1. I load the mesh file
2. I load the texture
3. I create a new object with the mesh from 1. and use the texture from 2.
4. I always delete the not used meshes and textures after the objects are created. But doing so does not make a difference. If I don't delete them nothing changes.
The game does not run smooth but that's because of the old system. Now the interesting part: The 3D objects are not shown even though there is free video memory (50 MB) if I use some smaller textures for the objects then some of them are drawn and some are not:
The game looks like this from above:
Then I press the Windows Key or Alt+Tab ... and after that I go back to my game... and guess what? All objects are correctly being displayed!
Take a look at this picture:
There are 1500-1700 objects in total that are being loaded. But why are they not displayed when I start my game? The game runs fullscreen but Windows mode doesn't help. Using windowed mode the objects are not displayed and pressing Alt+Tab does not help at all. Using stay active in the code doesn't help.
I've tried both DarkBasic 1.13 or the latest 1.21 version - it's exactly the same error. I've also tried different setting for the setup.ini... no luck so far!
Does anybody know a trick here? On a normal up to date system there are no problems... but I want my game to run on slower systems, too and don't understand how DarkBasic uses textures and RAM and video memory.
Yes 1500 objects are a lot of objects... When I use the make object method with the meshes ... is this the best way to do so? I don't want to load too much different images. Is this the best way to make sure the texture is only loaded once and then used for different objects?
I tried to use image flag 1 or 2 for direct loading or texture compression but it didn't help. Using texture compression has a bug, too. When you load an image with texture compression for example on numer 100 and map this image to a matrix. If you change the screen resolution and then try to load the image again on number 100 using texture compression the game crashes. Even if you try to delete the image after chaning the screen resolution the game crashes. You can delete the image as long as you don't change screen resolution.
I use the latest Intel driver and Windows 7 32-Bit.
A friend of mine has exactly the same problem with my game on a similar Atom Netbook but his system is newer. On other older systems some objects are shown and loaded - but not all are displayed when the game is being started. You always need to press Alt+Tab.
I would be glad if anybody could help me here!
Thank you very much!
Rylex
P.S. This is the upper part of my setup.ini
[SETTINGS]
TextLanguage=English
TextLanguage-Charset=1
HelpLanguage=English
HelpLanguage-Charset=1
HelpFontSize=0
ExternalEditor=None
blitflipmode=1
vbcreate=0
vbusage=0
3doverlay=0
runtimetest=1
tracemode=0
windowmode=0
popupoff=0