Hello guys, todays problem relies on the texture loading, I’m working with PureBasic at the moment, which is fast enough in my opinion. but the method im using for the textures is really slow.
Im reading every pixel and storing it into an array, this is slow!.
heres a code snippet:
img = LoadImage(#PB_Any, filename.s)
Width.l=ImageWidth()
Height.l=ImageHeight()
Size.l=Width * Height
Dim ImageData.b(Size*3)
StartDrawing(ImageOutput())
For y=0 To Height-1
For x=0 To Width-1
Color = Point(x,y)
ImageData(i)=Red(Color)
i+1
ImageData(i)=Green(Color)
i+1
ImageData(i)=Blue(Color)
i+1
Next
Next
StopDrawing()
after that I call gentextures and set the filter…
Does anyone know of a faster method for loading textures? in purebasic LoadImage is very fast, thats not the problem (a 2048x2048 blank bitmap takes 120 millisecs to load).
If theres no other method I could work with, what lib do you suggest me to use for reading the pixels? (that seems the slow part of my method).
thanks in advice