Graphics simply will not work

Archives Forums/Linux Discussion/Graphics simply will not work

plash(Posted 2008) [#1]
I've tried all the combinations I could think of (graphics/glgraphics, all the drivers and changed the flags around), graphics will never work. Is there a lib I need for this to work, or some other package?

Here's the code I've been playing around with:
'SetGraphicsDriver GLMax2DDriver()
SetGraphicsDriver GLGraphicsDriver()
Graphics 800, 600, 0, 75
'GLGraphics 800, 600, 0, 75, GRAPHICS_BACKBUFFER

DrawText "hallo.", 50, 50

Flip()

WaitKey()


NOTE: For some reason, whenever a blitzmax program tries to go into fullscreen I have to restart my system, its the only way I have found to get out of it.


Htbaa(Posted 2008) [#2]
What distribution are you using? How old is it? Are the right drivers installed for your video card? Are the graphics hardware accelerated?

If the system needs to restart something isn't right, obvious. Is X properly configured?


plash(Posted 2008) [#3]
Ubuntu 7.10, it was the most previous release, hardy heron (8.04) is gonna be officially released in like 6 days.

I'm not sure about the drivers, or where/how to get/install them. The gfx card is "Intel Graphics Media Accelerator 900", x41 lenovo tablet, its really weird that blitzmax graphics wont work because I can play games through wine just fine.

Yes X is configured correctly, the problem is within blitzmax I think. When it freezes you can't alt-tab, alt-f4, or anything. I've even assumed it shows an error, so I tried enter->alt-f4, no luck so far.


dawlane(Posted 2008) [#4]
Ctrl+Alt+BackSpace will restart the X server.
Tried your code on Ubuntu 8.04 beta and I get a unhandled exception.

Try this bit of code
SetGraphicsDriver GLMax2DDriver()
Local g:TGraphics=CreateGraphics( 640,480,0,60,GRAPHICS_BACKBUFFER )
SetGraphics g

DrawText "hallo",50,50

Flip()

WaitKey()
CloseGraphics(g)


At the moment I'm trying Ubuntu 8.04. For some reason keyboard input isn't working when using GL. And GLGraphics doesn't work.


plash(Posted 2008) [#5]
Yeah, you get a null object reference because graphics never was initialized successfully.
The code you posted is essentially the same exact thing as using just graphics (ie, it didn't work, the same error to access null object comes up).


dawlane(Posted 2008) [#6]
Have a look at this bit of code
SetGraphicsDriver GLGraphicsDriver()
GLGraphics 800,600,16
'glClear GL_COLOR_BUFFER_BIT    'uncomment if you get display corruption.
GLDrawText "Hallo",0,0
Flip
WaitKey


and this

SetGraphicsDriver GLMax2DDriver()
Graphics 800,600,16

DrawText "hallo",50,50

Flip

WaitKey
EndGraphics()



ImaginaryHuman(Posted 2008) [#7]
I could not get 7.10 to work on my mac, the graphics were all screwed up and it just wouldn't boot into the desktop all the way. I went back to 7.04 and had absolutely no problems - all I did was install the basic libs required for blitzmax and then the libs required for ati hardware accelerated opengl. See the threads on installing ubuntu.


dawlane(Posted 2008) [#8]
I'm not sure about the drivers, or where/how to get/install them.


In Ubuntu under the gnome desktop System->Administration->Restricted Drivers. It should list your graphics card driver there.


plash(Posted 2008) [#9]
In the Restricted Drivers window, all that is listed is "software modem driver", and at the top it says "No proprietary drivers are in use on this system".


dawlane(Posted 2008) [#10]
See if 3D Acceleration is enabled by using this command in a terminal.
glxinfo | grep rendering

If it is you will get this response
direct rendering: Yes

Here's a bit about the Intel Graphics Media Accelerator 900 card on the ubuntu forums http://ubuntuforums.org/showthread.php?t=54544

In the Xorg.conf file the bits of interest are these

Section "Module"
Load "bitmap"
Load "dbe"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "record"
Load "type1"
Load "vbe"
EndSection

And
Section "Device"
Identifier "Intel Corporation Intel Default Card"
Driver "i810"
BusID "PCI:0:2:0"
VideoRam 65536
Option "XaaNoOffscreenPixmaps"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 31.5-90
VertRefresh 60.0-60.0
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation Intel Default Card"
Monitor "Generic Monitor"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1280x768"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x768"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x768"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x768"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x768"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x768"
EndSubSection
EndSection



plash(Posted 2008) [#11]
3d acceleration is on, none of that stuff above helped (added/changed things from that config). I had pretty much the same config for my graphics card already.


Htbaa(Posted 2008) [#12]
After you change your Xorg configuration you need to restart Xorg or else the changes aren't active.


plash(Posted 2008) [#13]
I did.


dawlane(Posted 2008) [#14]
Make sure that these libs are installed


libglu1-mesa-dev
x11proto-core-dev
x11proto-gl-dev
x11proto-kb-dev
libxxf86vm-dev
libasound2-dev

g++-3.3 (if needed)

And is your distro of Ubuntu 32bit or 64bit ?


plash(Posted 2008) [#15]
I already have all of those packages. 32bit Intel Pentium 1.50ghz.


dawlane(Posted 2008) [#16]
Ok lets see what other things glxifo spews out in a command terminal.

Look for
OpenGL vendor string
OpenGL renderer string
OpenGL version string

And see what they say.
And just on the off chance have you rebuilt any modules? You may have a problem if you built against the GCC4.1/GCC4.2 libs.

And printout you're xorg.conf if your driver shows i810 instead on intel then the Accelerated driver isn't installed.
And to see if the required module is installed use lsmod in the command terminal and look for intel (if it says i810 then it's the xorg driver)


plash(Posted 2008) [#17]
I don't have glxifo, and don't know where to get it.

Just rebuilt mods, still no luck.

This is my original xorg.conf (not modified with anything you posted earlier), without the comments.


The four lines that standout from lsmod are "drm 83348 3 i915", "i915 25856 2", "intel_agp 25620 1" and "agpgart 35016 3 drm,intel_agp".


dawlane(Posted 2008) [#18]
I don't have glxifo, and don't know where to get it.

Sorry is should have said "glxinfo"


plash(Posted 2008) [#19]
Whoops! I can't believe I didn't notice that..
Anywho, heres what I get from glxinfo:
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) 915GM 20061017 x86/MMX/SSE2
OpenGL version string: 1.3 Mesa 7.0.1

I can't remember whether graphics worked in 1.18 or not, I'll try that out and see what happens.
EDIT:Nope. No luck with that, none of the samples worked either.


dawlane(Posted 2008) [#20]
Your drivers seem correct.
Well having trawled through many of the forum's. It looks like there are lots of issues with this video card and possible solutions ( it's just a pain finding the right answers if any ).


1) Don't up grade Ubuntu from 7.04 to 7.10. It's best to do a clean install.
2) If you are using an Intel GMA card with AIGLX. Use this bit of code in the command terminal.
LIBGL_ALWAYS_INDIRECT=1 INTEL_BATCH=1 compiz --replace --indirect-rendering --sm-disable ccp &

All found here http://ubuntuforums.org/showthread.php?t=582873

3) Follow the "Intel Graphics Media Accelerator 900 Xorg Howto" http://ubuntuforums.org/showthread.php?t=54544.

I don't think it's a problem with BlitzMax it's more of a Video card/driver issue.

As I'm using a nVidia and ATI chipsets, and I'm unable to test any of these.
You may find it better to ask in the Ubuntu forums and post the full system specs.

Sorry I couldn't be of much help.


plash(Posted 2008) [#21]
1) Thats going to be a last effort thing for me, as my tablet does not have a cd drive (getting it installed the first time was horrid).

2) Yeah.. uhh, was that supposed to make X all warpy?
EDIT2: A restart fixed the problem
<images removed>

My card is GMA but I don't know about AIGLX. it didn't fix graphics btw.

3) Working on it. EDIT: I have the same problem as the last poster, here is the output of 'sudo apt-get install linux-headers-$(uname -r)':
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-2.6.22-14-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Doing the ./install.sh says "ERROR: Kernel modules did not compile".


plash(Posted 2008) [#22]
I still don't think its my graphics card, as I stated earlier, I can run games through wine just fine (pretty graphics intense too).

EDIT: I'm just going to wait for Hardy Heron to be released and try it, if that doesn't fix my problem I will revert to 7.04. I seem to remember the samples worked in that version. Though none of this makes sense if it is indeed a graphics card problem, as I keep saying, I can run games just fine.


plash(Posted 2008) [#23]
BLAH!! doesn't work in 8.04.. I'm going to play around with it a little more before I switch back to 7.04.


plash(Posted 2008) [#24]
Awesome.. that gcc reinstall got it to work. I suppose forgetting little things can cause big problems. Thanks a BUNCH!