MOJO2
Monkey Forums/Monkey Programming/MOJO2| 
 | ||
| WTF!!! Why no image is displayed??? 
Import mojo2
Function Main()
    New MyGame()
End
Class MyGame Extends App
	Field canvas:Canvas
	Field img:Image
	Method OnCreate()
		canvas=New Canvas
		SetUpdateRate 60
		img=Image.Load("banco.png",0,0)
	End Method
	
	Method OnUpdate()
	End Method
	
	Method OnRender()	
		canvas.Clear()		
		canvas.DrawImage img,10,10		
		canvas.Flush()	
	End Method
End
Even if I change "canvas.Clear()" to "canvas.Clear(255,255,255)" just a black square - the image's size - is displayed on an white canvas. If I run in HTML5 the image is displayed correctly. | 
| 
 | ||
| It's working fine here. Are you sure it's actually loading the image? Because it sounds like it's just in the wrong place or has the wrong name. Have you tried a different image? | 
| 
 | ||
| On HTML5 it's working fine... | 
| 
 | ||
| That's even weirder. Maybe it's a driver issue? Do the official examples work? They're located in "modules/mojo2/bananas". | 
| 
 | ||
| yes, the examples work... don't know what to do.... :( | 
| 
 | ||
| If you don't mind uploading the file, I could try it myself. Is it possible you're using a file with the wrong file extension? For example, a JPG file named PNG, despite being the JPEG format. In HTML5's case, it doesn't really care what the format is, as long as the browser can load it. | 
| 
 | ||
| no, no problem.. here go the code and images.. I'm thinking it's something with the image, because I copied one image from another sample and it did work fine, although my image is correct. https://drive.google.com/open?id=0B8T1s0TV53yeWmIxZTNfUlA5VjA | 
| 
 | ||
| Okay, I'm not sure what's wrong, either. It's working on my machine, even under regular GLFW3:   | 
| 
 | ||
| with regular GLFW3 I can't run mojo2 and with mojo the image is displayed perfectly... | 
| 
 | ||
| Hang on, what about GLFW3+ANGLE, then? (Assuming you're on Windows) By the way, what version of Monkey are you using? | 
| 
 | ||
| I just can use mojo2 on GLFW3+ANGLE, not with GLFW. And I'm using the 85E. | 
| 
 | ||
| It doesn't display the image on GLFW3+ANGLE, then, right? Or does it only work with regular GLFW3? As a side note, if regular GLFW3 doesn't work, it's probably due to bad OpenGL drivers. ANGLE on the other hand doesn't use OpenGL. I'd say it could be a driver issue, but then again, your browser displays it fine, and you said the examples worked. To be honest, I'm lost. | 
| 
 | ||
| when I run mojo2 with GLFW3 only, I got this error: Memory Access Violation on that line: glGenerateMipmap GL_TEXTURE_2D of method UpdateMipmaps (graphics.monkey) | 
| 
 | ||
| Sounds like a lack of OpenGL 3 support to me. Regardless, ANGLE should be working fine for you. I'm not sure why your image wasn't working, though. You could try messing around with the image flags, I guess. | 
| 
 | ||
| I use Image.Filter and the image appear.. Figure it out... kkkkkkk Anyway, I'll do others tries. Thanks a lot. |