func main() { // create the foundation: a new window, basic scene, and game component (node) GT.EngineStart() probe := Opengl.Probe() Logging.Info("Max Texture Size: ", probe.MaxTextureSize) Logging.Info("Max Texture Image Units: ", probe.MaxTextureImageUnits) Logging.Info("Shader Version: ", probe.ShaderVersion) }
func newAggregateImage() *AggregateImage { newIdx := len(aggregateImages) aggrImg := &AggregateImage{} aggrImg.id = newIdx fmt.Println("img id: ", aggrImg.id) aggrImg.imageBuddy = NewBuddyAggregator(int(Opengl.Probe().MaxTextureSize)) aggregateImages = append(aggregateImages, aggrImg) return aggrImg }
/** NewAggregateImage * * Walk the directory and aggregate all images to one image and store in meemory * @param {[type]} location string [description] */ func LoadImages(path string) { loadTextureImages(path) loadFontImages() // create empty image to hold all images texSize := int(Opengl.Probe().MaxTextureSize) for _, aggrImg := range aggregateImages { finalImg := image.Rectangle{image.Point{0, 0}, image.Point{texSize, texSize}} rgbaFinal := image.NewRGBA(finalImg) // store the final aggregate image aggrImg.aggregateImage = rgbaFinal Opengl.AddAggregateImage(aggrImg.aggregateImage) } // draw all images img.(*image.RGBA) for _, imgSec := range images { img := aggregateImages[imgSec.aggrId].aggregateImage rgbaFinal, _ := img.(*image.RGBA) draw.Draw(rgbaFinal, imgSec.Section, imgSec, image.Point{0, 0}, draw.Src) // draw images } // now fonts for _, fontSec := range fonts { img := aggregateImages[fontSec.aggrId].aggregateImage rgbaFinal, _ := img.(*image.RGBA) draw.Draw(rgbaFinal, fontSec.Section, fontSec, image.Point{0, 0}, draw.Src) // draw images } //TODO add flag for displaying this // for idx, aggrImg := range aggregateImages { // // aggrImg.Print("aggrimg" + strconv.Itoa(idx) + ".png") // } }