Not Drawing Images in Some Computers
BlitzMax Forums/BlitzMax Beginners Area/Not Drawing Images in Some Computers
| ||
Here in my college, my game runs in computers here, but no fonts or images are drawn on screen: only the default drawing commands like drawrect, drawline, plot, etc... Here's a screenshot of the game running, you can't see the base, the enemies, anything. Only The shots and health bars. And since nothing is being drawn over them, they don't go away. It has DX9 installed, it is a 1.0ghz machine with 256mb ram I believe. So it's a computer that should have been able to run the game. Anything I can do? (Also, the last 4 questions here are mine, should I stop asking things all the time or it's ok? :P ) |
| ||
Hunmmm, post some code Bmax doesnt actualy use DX9 as standard, it uses DX7, but I dont think thats a problem Set the graphics driver to something else, and see whats happening. It could be that the font you want doesnt exist? SetGraphicsDriver D3D7Max2DDriver SetGraphicsDriver GLMax2DDriver() SetGraphicsDriver GLGraphicsDriver() (Edit: There is a life time limit of 5 questions) |
| ||
Well I didn't have access to my code in college, so here it is now. I can't compile anything there, so I guess I should compile several different versions of the app and test all of them there? SetGraphicsDriver D3D7Max2DDriver() _CURGRAPHICS = Graphics(800,600,_WINDOW,60,GRAPHICS_BACKBUFFER) If _CURGRAPHICS = Null Then SetGraphicsDriver GLMax2DDriver() _CURGRAPHICS = Graphics(800,600,_WINDOW,60,GRAPHICS_BACKBUFFER) If _CURGRAPHICS = Null Then RuntimeError "DirectX and OpenGL are not supported in this system." Else Notify "Graphics Driver automatically switched to OpenGL" EndIf EndIf I have no idea if this works or not by the way :P I didn't get any notify or runtime error there, so my guess it is running on DX7. And the font I want is in included in the game, I don't use anything in the windows folder. (Oh damn :P ) |
| ||
When you copied the game to the college computer, did you also copy the fonts and the images to it? If you used Incbin, are you sure you're loading from the incbinned data, i.e. LoadImage("Incbin::MyImage.png")? |
| ||
Yes, I'm completely sure. I got the 0.5b version of my game: http://www.sendspace.com/file/xbhxjq It works everywhere else, everything is included there. If the images weren't available, I would have a memory access violation error if I'm not mistaken. |
| ||
No images missing are skipped right past. |
| ||
What happens when ppl try to open a graphics context on a card that only has 8Bit colors? |
| ||
But the images are in the exact same place they should be. They are supposed to be loaded. Is there a way to check for an exception when loading a file? |
| ||
But the images are in the exact same place they should be. They are supposed to be loaded. Is there a way to check for an exception when loading a file? a=LoadImage("image.jpg") If a=0 Then Print "Error loading Image" |
| ||
Actually I think Mo7hM4n is right. It won't give you an error if an image isn't loaded, but it should give you an error if you try and use that image somewhere. |
| ||
Maybe your driver doesnt support textures? Maybe your textures are too large? |
| ||
Yes, now that I remember, I think you can load them just fine even if they are not there, but when you try to draw them you'll get an error. So... if the case is that they weren't loading, the game wouldn't even be working. So my guess is that they are loading, but the driver doesn't support images. Is there any way to find out if a driver supports something or not, then change if it doesn't? |
| ||
How much video ram do you have? |
| ||
I have no idea, I'll check next time I'm at college. I'm suspecting maybe they have those crappy 8mb onboard video cards, could that be the problem? |
| ||
on 8MB video cards you most likely get problems with texture sizes as well as they are restricted to 256x256 max size textures (square power of 2 is assumed to be default anything else won't load on anything older or cheaper than 4 years anyway) |
| ||
The computers at my school have 4mb on-board video cards, and I can run Blitzmax programs on most of them with no problem. |
| ||
So we're back at the original question. Why are they not drawing? |
| ||
Did you try the different drivers? Did you check the driver levels? What's the smallest failing example code? What is the image size being used? Does the graphics card supoort pow2 and/or need square textures? |
| ||
Time for a generic hello world test. ;) See if you can get 1 image to draw. |
| ||
What resolution is the desktop - that will consume video ram. Then when resolution is the display or window you're opening? That will consume video ram. If you have buffers other than the color buffer, such as depth buffer, alpha, stencil etc, those will consume video ram. From 4mb you may not have much left over for textures. |
| ||
4MB video card means no video card. Those card definitely do NOT support 3D with T&L This means BM is fully running on CPU and depending on the drivers installed, this works worse than not rendering anything at all. Not drawing images for example could mean that the drivers (S3 I just assume) do not support ortographic rendering or texture mapping of textures that do not meet specific needs. I'm sorry but such systems do not even meet the minimum requirement for Max2D and no mather which driver you use: they will never. If something works: you were lucky but 99% of the time, pure 2D office systems from 1996 - 1998 will NOT work with 2D through 3D system as Max2D Use BlitzPlus and Blitz3D 2D elements for 2D games on those systems |