Running ThreeJS (3D JS library) in the WebGadget

Share your advanced PureBasic knowledge/code with the community.
firace
Addict
Addict
Posts: 903
Joined: Wed Nov 09, 2011 8:58 am

Running ThreeJS (3D JS library) in the WebGadget

Post by firace »

Quick example below, Windows only.
Tested with ThreeJS r71. (More recent versions may or may not not work)

Code: Select all


dwLabel.s   = GetFilePart(ProgramFilename())  
dwValue.i   = 11001

rPath.s       = "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION"
RegCreateKeyEx_(#HKEY_CURRENT_USER, rPath.s, 0, #Null, #REG_OPTION_VOLATILE, #KEY_ALL_ACCESS, #Null, @phkResult, @Disposition)
RegSetValueEx_(phkResult, @dwLabel, 0, #REG_DWORD, @dwValue, SizeOf(Long))


OpenWindow(0, 432, 42, 900, 500, "Window_0", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)

WebGadget(0, 10, 10, 880, 450, "https://codepen.io/nicolasdnl/full/zxedvW")

webView.IWebBrowser2=GetWindowLongPtr_(GadgetID(0),#GWL_USERDATA)
webView\put_Silent(#True) 

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow 
Last edited by firace on Mon Jul 05, 2021 8:57 pm, edited 2 times in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Running ThreeJS (3D JS library) in the WebGadget

Post by Kwai chang caine »

Works here !!!! :D

Image

Thanks for sharing 8) and learning to me the existence of the powerfull "ThreeJS" :shock:
ImageThe happiness is a road...
Not a destination
Post Reply