Merge pull request #40 from Vulpovile/hypersnap-engine

Added lots of tools
This commit is contained in:
Vulpovile
2020-03-10 12:15:55 -07:00
committed by GitHub
31 changed files with 228 additions and 59 deletions

View File

@@ -20,7 +20,6 @@
#include <string>
#include "ax.h"
#include <cguid.h>
#include "IEBrowser.h"
#include "PropertyWindow.h"
#include <commctrl.h>
#include "StringFunctions.h"
@@ -114,7 +113,7 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
Win32Window* window = Win32Window::create(_settings.window,_hwndRenderer);
ShowWindow(_hwndRenderer, SW_SHOW);
ShowWindow(_hWndMain, SW_SHOW);
quit=false;
rightButtonHolding=false;
mouseOnScreen=false;
@@ -135,10 +134,23 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
SetWindowLongPtr(_hWndMain,GWL_USERDATA,(LONG)this);
SetWindowLongPtr(_hwndRenderer,GWL_USERDATA,(LONG)this);
_propWindow = new PropertyWindow(0, 0, 200, 640, hThisInstance);
IEBrowser* webBrowser = new IEBrowser(_hwndToolbox);
webBrowser->navigateSyncURL(L"http://androdome.com/res/ClientToolbox.php");
webBrowser = new IEBrowser(_hwndToolbox);
SetWindowLongPtr(_hwndToolbox,GWL_USERDATA+1,(LONG)webBrowser);
//webBrowser->navigateSyncURL(L"http://androdome.com/res/ClientToolbox.php");
//navigateToolbox(GetFileInPath("/content/page/controller.html"));
navigateToolbox(GetFileInPath("/content/page/surface.html"));
}
void Application::navigateToolbox(std::string path)
{
int len = path.size() + 1;
wchar_t * nstr = new wchar_t[len];
MultiByteToWideChar(0, 0, path.c_str(), len, nstr, len);
webBrowser->navigateSyncURL(nstr);
delete[] nstr;
}
void Application::deleteInstance()
{
@@ -333,7 +345,7 @@ void eject(PartInstance * colliding, PartInstance * collider)
if(colliding == collider || !colliding->canCollide || !collider->canCollide)
return;
if(G3D::CollisionDetection::fixedSolidBoxIntersectsFixedSolidBox(collider->getBox(), colliding->getBox()))
collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3);
collider->setVelocity(collider->getVelocity().reflectionDirection(colliding->cFrame.upVector())/1.3F);
}
@@ -512,7 +524,7 @@ int Application::getMode()
void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, LightingParameters lighting, Vector3 size, Vector3 pos, CoordinateFrame c)
{
rd->disableLighting();
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
float offsetSize = 0.05F;
//X
@@ -534,8 +546,6 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
if(_mode == ARROWS)
{
rd->setLight(0, NULL);
rd->setAmbientLightColor(Color3(1,1,1));
AABox box;
c.toWorldSpace(Box(from, to)).getBounds(box);
@@ -556,14 +566,10 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
rd->setAmbientLightColor(lighting.ambient);
rd->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor));
}
else if(_mode == RESIZE)
{
Color3 sphereColor = outline;
rd->setLight(0, NULL);
rd->setAmbientLightColor(Color3(1,1,1));
Vector3 gamepoint = pos;
Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
@@ -573,25 +579,23 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
float multiplier = distance * 0.025F/2;
if(multiplier < 0.25F)
multiplier = 0.25F;
Vector3 position = pos + (c.lookVector()*((size.z/2)+1));
Vector3 position = pos + (c.lookVector()*((size.z)+1));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos - (c.lookVector()*((size.z/2)+1));
position = pos - (c.lookVector()*((size.z)+1));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos + (c.rightVector()*((size.x/2)+1));
position = pos + (c.rightVector()*((size.x)+1));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos - (c.rightVector()*((size.x/2)+1));
position = pos - (c.rightVector()*((size.x)+1));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos + (c.upVector()*((size.y/2)+1));
position = pos + (c.upVector()*((size.y)+1));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos - (c.upVector()*((size.y/2)+1));
position = pos - (c.upVector()*((size.y)+1));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
}
rd->setAmbientLightColor(lighting.ambient);
rd->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor));
}
rd->enableLighting();
}
void Application::exitApplication()

View File

@@ -4,6 +4,7 @@
#include "TextButtonInstance.h"
#include "ImageButtonInstance.h"
#include "CameraController.h"
#include "IEBrowser.h"
//#include "GuiRoot.h"
class TextButtonInstance;
@@ -25,6 +26,7 @@ class Application { // : public GApp {
virtual void onUserInput(UserInput* ui);
virtual void onCleanup();
void clearInstances();
void navigateToolbox(std::string);
PartInstance* makePart();
void drawButtons(RenderDevice* rd);
void drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, LightingParameters lighting, Vector3 size, Vector3 pos, CoordinateFrame c);
@@ -72,6 +74,7 @@ class Application { // : public GApp {
int _mode;
GAppSettings _settings;
double lightProjX, lightProjY, lightProjNear, lightProjFar;
IEBrowser* webBrowser;
protected:
Stopwatch m_graphicsWatch;
Stopwatch m_logicWatch;

View File

@@ -1,6 +1,6 @@
#pragma once
#include "DataModelInstance.h"
#include <G3DAll.h>
class Application;

View File

@@ -37,6 +37,7 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
g_fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
g_fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
//Bottom Left
TextButtonInstance* button = makeTextButton();
button->boxBegin = Vector2(0, -24);
button->boxEnd = Vector2(80, 0);
@@ -48,6 +49,9 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->title = "Hopper";
button->fontLocationRelativeTo = Vector2(10, 3);
button->setAllColorsSame();
button->boxOutlineColorOvr = Color3(0,255,255);
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
button = makeTextButton();
button->boxBegin = Vector2(0, -48);
@@ -60,6 +64,9 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->title = "Controller";
button->fontLocationRelativeTo = Vector2(10, 3);
button->setAllColorsSame();
button->boxOutlineColorOvr = Color3(0,255,255);
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
button = makeTextButton();
button->boxBegin = Vector2(0, -72);
@@ -72,6 +79,8 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->title = "Color";
button->fontLocationRelativeTo = Vector2(10, 3);
button->setAllColorsSame();
button->boxOutlineColorOvr = Color3(0,255,255);
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
button = makeTextButton();
button->boxBegin = Vector2(0, -96);
@@ -84,6 +93,8 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->title = "Surface";
button->fontLocationRelativeTo = Vector2(10, 3);
button->setAllColorsSame();
button->boxOutlineColorOvr = Color3(0,255,255);
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
button = makeTextButton();
button->boxBegin = Vector2(0, -120);
@@ -92,11 +103,14 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->setParent(this);
button->font = g_fntlighttrek;
button->textColor = Color3(0,255,255);
button->boxOutlineColor = Color3(0,255,255);
button->title = "Model";
button->selected = true;
button->fontLocationRelativeTo = Vector2(10, 3);
button->setAllColorsSame();
button->boxOutlineColorOvr = Color3(0,255,255);
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
//Top bar
button = makeTextButton();
button->boxBegin = Vector2(0, 0);
button->boxEnd = Vector2(125, 25);
@@ -109,6 +123,7 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->textSize = 16;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button = makeTextButton();
button->boxBegin = Vector2(125, 0);
@@ -122,6 +137,7 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->textSize = 16;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button = makeTextButton();
button->boxBegin = Vector2(250, 0);
@@ -135,6 +151,7 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->textSize = 16;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button = makeTextButton();
button->boxBegin = Vector2(375, 0);
@@ -148,6 +165,7 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->textSize = 16;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button = makeTextButton();
button->boxBegin = Vector2(500, 0);
@@ -161,9 +179,10 @@ GuiRoot::GuiRoot() : _message(""), _messageTime(0)
button->textSize = 16;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
//Menu
button = makeTextButton();
button->boxBegin = Vector2(0,215);
button->boxEnd = Vector2(80,235);
@@ -382,7 +401,7 @@ void GuiRoot::drawButtons(RenderDevice* rd)
{
rd->pushState();
rd->beforePrimitive();
this->render(rd);
//this->render(rd);
rd->afterPrimitive();
rd->popState();
}
@@ -422,7 +441,7 @@ void GuiRoot::renderGUI(G3D::RenderDevice* rd, double fps)
g_fntlighttrek->draw2D(rd,"MENU", Vector2(10,332), 14, Color3::white(), Color4(0.5F,0.5F,0.5F,0.5F));
drawButtons(rd);
//drawButtons(rd);
if(System::time() - 3 < _messageTime)
{
g_fntdominant->draw2D(rd, _message, Vector2((rd->getWidth()/2)-(g_fntdominant->get2DStringBounds(_message, 20).x/2),(rd->getHeight()/2)-(g_fntdominant->get2DStringBounds(_message, 20).y/2)), 20, Color3::yellow(), Color3::black());

View File

@@ -7,11 +7,54 @@
#include "IEBrowser.h"
#include "Globals.h"
#pragma once
#include "ax.h"
void IEBrowser::Boop(char* test)
HRESULT IEBrowser::doExternal(std::wstring funcName,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS FAR* pDispParams,
VARIANT FAR* pVarResult,
EXCEPINFO FAR* pExcepInfo,
unsigned int FAR* puArgErr)
{
// External functions may end up here in the future
if (funcName==L"Insert")
{
MessageBoxW(NULL, pDispParams->rgvarg->bstrVal,L"Add insert here...",MB_OK);
return S_OK;
}
else if (funcName==L"ToggleHopperBin")
{
MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
}
else if (funcName==L"SetController")
{
bool ding = false;
//int len = SysStringLen(pDispParams->rgvarg->bstrVal)+1;
//char * args = new char[len];
//WideCharToMultiByte(CP_ACP, 0, pDispParams->rgvarg->bstrVal, len, args, len, NULL, (LPBOOL)TRUE);
if(pDispParams->rgvarg->intVal < 0 || pDispParams->rgvarg->intVal > 7)
return S_OK;
Enum::Controller::Value cont = (Enum::Controller::Value)pDispParams->rgvarg->intVal;
for(size_t i = 0; i < g_selectedInstances.size(); i++)
{
if(PVInstance* part = dynamic_cast<PVInstance*>(g_selectedInstances.at(i)))
{
ding = true;
part->controller = cont;
}
}
if(ding)
AudioPlayer::playSound(dingSound);
return S_OK;
}
else
{
return E_NOTIMPL;
}
}
IEBrowser::IEBrowser(HWND attachHWnd) {
@@ -39,9 +82,10 @@ IEBrowser::~IEBrowser(void) {
bool IEBrowser::navigateSyncURL(wchar_t* url)
{
MSG messages;
//MSG messages;
if (webBrowser)
{
webBrowser->Navigate(url,0,0,0,0);
}
else

View File

@@ -1,16 +1,27 @@
//#include "WindowFunctions.h"
#pragma once
#include "Globals.h"
#pragma once
#include <mshtml.h>
#include <exdisp.h>
#include <Mshtmhst.h>
#include "IEDispatcher.h"
#include "AudioPlayer.h"
class IEBrowser {
public:
IEBrowser(HWND attachHWnd);
~IEBrowser(void);
bool navigateSyncURL(wchar_t* url);
void Boop(char* test);
HRESULT doExternal(std::wstring funcName,
DISPID dispIdMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS FAR* pDispParams,
VARIANT FAR* pVarResult,
EXCEPINFO FAR* pExcepInfo,
unsigned int FAR* puArgErr);
private:
IWebBrowser2* webBrowser;
HWND hwnd;

View File

@@ -98,12 +98,7 @@ void TextButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseD
Draw::box(Box(point1, point2), rd, boxColorDn, boxOutlineColorDn);
font->draw2D(rd, title, RelativeTo, textSize, textColorDn, textOutlineColorDn);
}
else if(mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y))
{
Draw::box(Box(point1, point2), rd, boxColorOvr, boxOutlineColorOvr);
font->draw2D(rd, title, RelativeTo, textSize, textColorOvr, textOutlineColorOvr);
}
else if(selected)
else if(selected || mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y))
{
Draw::box(Box(point1, point2), rd, boxColorOvr, boxOutlineColorOvr);
font->draw2D(rd, title, RelativeTo, textSize, textColorOvr, textOutlineColorOvr);

31
ax.cpp
View File

@@ -1,10 +1,7 @@
// AX.CPP
#include <windows.h>
#include <comdef.h>
#include <exdisp.h>
#include <oledlg.h>
#include "ax.h"
#include "AudioPlayer.h"
#include "Enum.h"
#pragma warning (disable: 4311)
#pragma warning (disable: 4312)
@@ -106,6 +103,8 @@ STDMETHODIMP AXClientSite :: FilterDataObject( IDataObject *pDO, IDataObject **p
STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject)
{
*ppvObject = 0;
// if (iid == IID_IOleInPlaceSite)
// *ppvObject = (IOleInPlaceSite*)this;
if (iid == IID_IOleClientSite)
*ppvObject = (IOleClientSite*)this;
if (iid == IID_IUnknown)
@@ -114,7 +113,7 @@ STDMETHODIMP AXClientSite :: QueryInterface(REFIID iid,void**ppvObject)
*ppvObject = (IAdviseSink*)this;
if (iid == IID_IDispatch)
*ppvObject = (IDispatch*)this;
if (ExternalPlace == false)
//if (ExternalPlace == false)
{
if (iid == IID_IOleInPlaceSite)
*ppvObject = (IOleInPlaceSite*)this;
@@ -506,22 +505,10 @@ HRESULT _stdcall AXClientSite :: Invoke(
EXCEPINFO FAR* pExcepInfo,
unsigned int FAR* puArgErr)
{
if (m_lastExternalName==L"Insert")
{
MessageBoxW(NULL, pDispParams->rgvarg->bstrVal,L"Add insert here...",MB_OK);
return S_OK;
}
else if (m_lastExternalName==L"Boop")
{
MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
}
else
{
return E_NOTIMPL;
}
return S_OK;
IEBrowser * browser = (IEBrowser *)GetWindowLongPtr(Window,GWL_USERDATA+1);
return browser->doExternal(m_lastExternalName,dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
//return S_OK;
}

5
ax.h
View File

@@ -1,6 +1,10 @@
// AX.H
#pragma once
#include "Globals.h"
#include <mshtmhst.h>
#include <string>
#pragma once
#include "IEBrowser.h"
// messages
#define AX_QUERYINTERFACE (WM_USER + 1)
@@ -38,7 +42,6 @@ class AXClientSite :
bool CalledCanInPlace;
class AX* ax;
// MyClientSite Methods
AXClientSite();
virtual ~AXClientSite();

BIN
content/images/BumpTool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
content/images/Clone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
content/images/GameTool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
content/images/GlueTool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
content/images/Grab.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
content/images/Hammer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
content/images/Laser.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
content/images/Rocket.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
content/page/color.html Normal file

Binary file not shown.

View File

@@ -0,0 +1,21 @@
<html>
<script>
function toolOvr(image)
{
if(image.src.indexOf("_dn.png") == -1)
image.src = image.src.replace(".png", "_dn.png");
}
function toolOut(image)
{
if(image.src.indexOf("_dn.png") != -1)
image.src = image.src.replace("_dn.png",".png");
}
</script>
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border:0;">
<img src="../images/Controller1Tool.png" onclick="window.external.SetController(1)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/Controller2Tool.png" onclick="window.external.SetController(2)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerAI1Tool.png" onclick="window.external.SetController(5)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerAI2Tool.png" onclick="window.external.SetController(6)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/ControllerNoneTool.png" onclick="window.external.SetController(0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
</body>
</html>

47
content/page/hopper.html Normal file
View File

@@ -0,0 +1,47 @@
<html>
<script>
function toolOvr(image)
{
image.style.backgroundColor = "#cccccc";
}
function toolOut(image)
{
image.style.backgroundColor = "transparent";
}
</script>
<style>
img{
height: 100%;
}
.container
{
height: 47px;
width: 50px;
margin-right: 10px;
}
</style>
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border:0;">
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(0)">
<img src="../images/GameTool.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(1)">
<img src="../images/Grab.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(2)">
<img src="../images/Clone.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(3)">
<img src="../images/Hammer.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(4)">
<img src="../images/Slingshot.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(5)">
<img src="../images/Rocket.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onclick="window.external.ToggleHopperBin(6)">
<img src="../images/Laser.png" />
</span>
</body>
</html>

23
content/page/surface.html Normal file
View File

@@ -0,0 +1,23 @@
<html>
<script>
function toolOvr(image)
{
if(image.src.indexOf("_dn.png") == -1)
image.src = image.src.replace(".png", "_dn.png");
}
function toolOut(image)
{
if(image.src.indexOf("_dn.png") != -1)
image.src = image.src.replace("_dn.png",".png");
}
</script>
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border:0;">
<img src="../images/FlatTool.png" onclick="window.external.SetSurface(0)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/BumpTool.png" onclick="window.external.SetSurface(1)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/HingeTool.png" onclick="window.external.SetSurface(2)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/LeftMotorTool.png" onclick="window.external.SetSurface(3)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/LeftMotorFastTool.png" onclick="window.external.SetSurface(4)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/RightMotorTool.png" onclick="window.external.SetSurface(5)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
<img src="../images/RightMotorFastTool.png" onclick="window.external.SetSurface(6)" onmousedown="toolOvr(this)" onmouseup="toolOut(this)"/>
</body>
</html>

View File

@@ -175,6 +175,18 @@ LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int main(int argc, char** argv) {
try{
hresult = OleInitialize(NULL);
/* IInternetSecurityManager *pSecurityMgr;
IInternetZoneManager *pZoneMgr;
LPCWSTR site1 = SysAllocString(L"http://www.androdome.com");
hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager, (void**)&pSecurityMgr);
pSecurityMgr->SetZoneMapping((DWORD)2, site1, (DWORD)0); // 2 = Trusted Site, site1 is the URL to add, and 0 is to create the entry.
*/
if (!AXRegister())
return 0;