BASIC

Author Topic: Missing graphics on certain computers  (Read 1448 times)

Offline Gary

  • Dr. Type
  • ****
  • Posts: 313
    • View Profile
This has had me stumped for 2 days now so time to ask the gurus for help  :nw:

I am working on a project and have a routine for displaying text by loading in the individual letters as sprites and breaking the string down into individual characters and drawing the sprite for the letter, setting the xpos to the width of the char plus current print pos so its ready to print the next char. The widths are in a look up table as I figured it would be quicker than getting sprite size on the fly each time.

Code: GLBasic [Select]
FUNCTION stringprint: string$,stringxpos,stringypos,center = TRUE

        LOCAL numchars, ctr, charypos, nextchar$,strlen=0

        numchars = LEN(string$)

        IF center
                stringypos=stringypos + 11 // I moved the graphics on the screen by 11 pixels and this was easier than reentering all the ypos values on each draw command
                FOR ctr = 0 TO numchars-1
                 strlen = strlen + char_width[ASC(string$,ctr)]
                NEXT
                stringxpos = stringxpos - (strlen/2)
        ENDIF

        FOR ctr = 0 TO numchars-1
                DRAWSPRITE 500+ASC(string$,ctr),stringxpos,stringypos
                stringxpos=stringxpos+char_width[ASC(string$,ctr)]
        NEXT

ENDFUNCTION
 

On my dev computer it displays fine as per the first screen shot. On the computer it needs to be deployed on it is missing the text totally. I did also try Peejays/morus text drawing routine (but as its a commercial project I dont want to use it for production as its their code) and this does exactly the same.

I have tried removing some of the graphics to keep the overheads down but that doesn't change anything so I am stumped.

The graphics card in the deployment PC is an Intel 82845G/GL/GE/PE/GV which I know does not do everything in the 3d department but I'm not doing anything fancy. All other sprites display correctly and everything else works apart from this one aspect.

Anyone else have any ideas as to what I could try? I'm on the verge of going back to a standard font and using the PRINT routine :) Its not a difference between full screen and windowed as the issues stay regardless of the settings

Thanks
Gary



[attachment deleted by admin]
« Last Edit: 2012-Jan-13 by Gary »

Offline Gary

  • Dr. Type
  • ****
  • Posts: 313
    • View Profile
Re: Missing graphics on certain computers
« Reply #1 on: 2012-Jan-13 »
just as a follow up to this PRINT does not seem to be working either. I put some code in to display the size of one of the sprites (to make sure they are being loaded ok) and again it works on my dev computer but on production it doesn't display anything.

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 930
  • KodeSource
    • View Profile
    • KodeSource
Re: Missing graphics on certain computers
« Reply #2 on: 2012-Jan-13 »
Very strange.

Some ideas:
  • Before loading, make sure the sprite files exist in the expected location by using the 'DOESFILEEXIST()' command
  • Try using the GENSPRITE() to allocate a sprite, if you are hard coding the sprite id (not likely to help, just a thought)
  • Try displaying just one character sprite at the 0,0 location to see if you can get a simple sprite example to display
  • Try displaying one character by using the POLYVECTOR technique

How do you display your other graphics?  DRAWSPRITE? 
If so, weird how just the characters don't display, even using PeeJay's routine.

If you have GLBasic installed on the problem PC, add a bunch of 'DEBUG' commands inside of the 'stringprint' function to see what screen locations are being used, plus what ascii characters are being determined from the string. 

It more looks like something is missing on that PC, a DLL or something.  Or an outdated OpenGL?
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

  • Guest
Re: Missing graphics on certain computers
« Reply #3 on: 2012-Jan-15 »
Also check the graphics card anti-aliasing settings too.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Missing graphics on certain computers
« Reply #4 on: 2012-Jan-16 »
can you test if ASC always returns positive numbers?