Mojo HTML5 GL

84 replies to this topic
Posted 7 months ago #76
MikeHart

What the hell. This is the 3rd time I answer now.

Thanks!

Let's see if that disapears again, LOL.

 
Posted 6 months ago #77
devolonter

Sorry for delay. Iíve just released an update. All issues should be fixed.

Changelog:

v1.35
* Added textured DrawPoly support
* Added support of async image loader
* Fixed value returned by getContext function for webgl and expreimental-webgl contexts
* Fixed issues with App.OnLoading event

 
Posted 6 months ago #78
MikeHart

Thanks man, just tried it and it works like a charm!

 
Posted 6 months ago #79
CopperCircle

Hi, thanks for the update, I just tried with the async image loader and it does not work? it stops the image from downloading, any ideas?
(Monkey v76a)

Import mojo

Class MyApp Extends App Implements IOnLoadImageComplete

	Field image:Image

	Method OnCreate()
		LoadImageAsync( "http://www.monkeycoder.co.nz/img/logo/cute/monkey1.png",1,Image.MidHandle,Self )
		SetUpdateRate 60
	End
	
	Method OnUpdate()
		UpdateAsyncEvents
	End
	
	Method OnRender()
		Cls
		DrawText "Hello World!",0,0
		If image Then DrawImage image,DeviceWidth()/2,DeviceHeight()/2
	End
	
	Method OnLoadImageComplete:Void( image:Image,path:String,source:IAsyncEventSource )
		If image Then Print "OK!" Else Print "ERR"
		Self.image=image
	End

End

Function Main()
	New MyApp
End
 
Posted 6 months ago #80
devolonter

@MikeHart glad to hear it!

@CopperCircle server with files must have special headers for allowing cross-domain image loading. More info: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing Your code will work in 2d context as well, but it wonít in webgl because it requires more rights for texture binding.

Also, script may work not properly with experimental Monkey versions, because I test code only with stable builds

 
Posted 6 months ago #81
CopperCircle

Thanks for the tip, didn't realise webgl needed more rights.

 
Posted 4 months ago #82
CopperCircle

Hi, can this be made to work with WebGL in IE11?

 
Posted 4 months ago #83
devolonter

Hi, WebGL support in IE is slightly incomplete, but this issue can be solved. I started to work on it, but currently it is not my priority task. Sorry.

 
Posted 4 months ago #85
Shockblast

I also noticed that this module does not work with IE11. I would also like it if IE is supported. In the mean time I use this to disable WebGL for IE11. It checks if the user agent does not have the word "trident" in it. "trident" is only used in the IE11 user agent string. So it is a temporary fix until IE11 is supported.

function init(id) {
		if (window.WebGLRenderingContext !== undefined) {
			if(navigator.userAgent.toLowerCase().indexOf('trident') === -1) {
				try {
					new WebGL2D(document.getElementById(id));
				} catch (e) { }
			}
		}
	}