Weird iPad Drawline problem...

Previous topic - Next topic

mrplant

Hi

I am writing a multi platform project - for mac it works fine in fullscreen mode - 1024x768

on the iPad however, the same code is doing weird things..

The screen size is 1024x768 in landscape.

This is the code I am using to draw a 1 pixel white border around a pure black screen:

CLEARSCREEN RGB(0,0,0) // Set the backbuffer background colour to Black.
DRAWLINE 0,0,1023,0, RGB (255, 255, 255) // Draw 1 pixel top border in White
DRAWLINE 0,767,1023,767, RGB (255, 255, 255) // Draw 1 pixel bottom border in White
DRAWLINE 0,0,0,767, RGB (255, 255, 255) // Draw 1 pixel left border in White
DRAWLINE 1023,0,1023,767, RGB (255, 255, 255) // Draw 1 pixel right border in White
SHOWSCREEN // Show it.

This code works fine on mac but on the iPad it is doing weird things..

In orientation mode landscape it is showing the box with the left edge missing (the line at 0,0 to 0,767 that is)
if the orientation is set to upside down landscape then the missing line is the one along the top..

I am on latest version but can't get my head around what is happening here when I compile this for iPad at 1024x768

Surely it should work fine like the desktop version does?

mrplant

#1
This is my full iPhone project (for iPad). Project settings are set to 1024x768 in GLBasic Project options. When compiled on Xcode - the following code fails to draw a solid rectangle around the border of the screen.
Any ideas why this is?


// --------------------------------- //
// Project: Test
// Start: Sunday, September 11, 2011
// IDE Version: 10.106


// SETCURRENTDIR("Media") // go to media files

DRAWLINE 0,0,1023,0, RGB (255, 255, 255) // Draw 1 pixel top border in White
DRAWLINE 0,767,1023,767, RGB (255, 255, 255) // Draw 1 pixel bottom border in White
DRAWLINE 0,0,0,767, RGB (255, 255, 255) // Draw 1 pixel left border in White
DRAWLINE 1023,0,1023,767, RGB (255, 255, 255) // Draw 1 pixel right border in White

SHOWSCREEN
SLEEP (4000)



This second version using DRAWRECT - this time for a 2 pixel border along the edge - also fails to draw the left hand edge:


// --------------------------------- //
// Project: Test
// Start: Sunday, September 11, 2011
// IDE Version: 10.106


// SETCURRENTDIR("Media") // go to media files

DRAWRECT 0,0,1023,2, RGB (255, 255, 255) // Draw 2 pixel top border in White
DRAWRECT 0,766,1023,2, RGB (255, 255, 255) // Draw 2 pixel bottom border in White
DRAWRECT 0,0,2,767, RGB (255, 255, 255) // Draw 2 pixel left border in White
DRAWRECT 1022,0,2,767, RGB (255, 255, 255) // Draw 2 pixel right border in White

SHOWSCREEN
SLEEP (4000)


My full code has rotation detection built into it and the weird thing is its either the top bar or the left bar that goes missing - depending on if the screen has been rotated upside down in landscape view or not..

mrplant

Anyone else with an ipad2 or ipad out there able to verify this?

Maybe it is something to do with me running iOS 5 beta 7?

Kitty Hello

it's off by 1 pixel?
I think I had that impression once, too. Would be a bug then. Might find time to fix that over the weekend.

mrplant

Yep. It seems to be missing the whole left hand 1 pixel line like it is just drawing it one pixel offscreen to the left.
Same happens along the top - depending on whether I have it set to landscape or upside down landscape orientation.

I worked around it at moment by importing a graphic that I created in photoshop that has a one pixel border and DRAWSPRITE that to the screen at 0,0 which works. I then clear screen -1 and superimpose the rest over it..

I can't remember at moment which way round it is - I think landscape has the line missing down left and upside down landscape has it missing along the top.

strange..