Hi. I wondered if anyone could help explain to me the image size limitations on mobile devices.
As I understand it, many older graphics cards and mobile devices will struggle with textures of over 1024 x 1024 px. I experienced this problem on my old XP laptop before AppGameKit upgraded to using OpenGL 2.0 so I couldn't test on it any more.
Anyhow what I wanted to know is whether this limitation will affect AppGameKit
images or only sprites created using them?
Let me give an example. Say I had a very large (let's say 4096 x 4096 px) image called MyLargeImage.jpg. Could I load this as an image in AppGameKit, break it down into 16 1024x1024px images using the memblock commands, and then create 16 sprites each linked to one of these smaller images?
The code might look something like this.
fullImage = LoadImage("MyLargeImage.jpg")
fullImageMemblock = CreateMemblockFromImage(fullImage)
DeleteImage(fullImage)
dim allImages[16]
dim allSprites[16]
index = 1
for c = 0 to 3
for d = 0 to 3
allImages[index] = makeImageFromMemblock(fullImageMemblock, c * 1024, d * 1024, 1024, 1024)
allSprites[index] = CreateSprite(allImages[index])
SetSpritePosition(allSprites[index], c * 1024, d * 1024)
inc index
next d
next c
do
Sync()
loop
function makeImageFromMemblock(memblock, x, y, width, height)
newImageMemblock = CreateMemblock(12 + (width * height * 4))
// code to extract sub image from memblock into newImageMemblock
newImage = CreateImageFromMemblock(newImageMemblock)
DeleteMemblock(newImageMemblock)
endfunction newImage
I was thinking that as this would avoid me ever having to actually render the oversized image, that might be OK, but I'm not sure whether images are affected by the problem as well.
Any help with this would be greatly appreciated. Thanks
.