Skip to content

Commit

Permalink
v7.0.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dtugend committed Nov 23, 2021
1 parent f4c5a95 commit 85f5277
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
7 changes: 7 additions & 0 deletions afx-cefhud-interop/assets/examples/default/drawing.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ <h2>Last game events:</h2>
};

this.messageHandlers = {
"ping": async function(i){
console.log("PING: "+i);
await Utils.toPromise(this.interop, "sendMessage",this.engineInteropId, JSON.stringify({
"id": "pong",
"args": [i]
}));
},
"connect": async function(senderId) {
this.engineInteropId = senderId;
await this.connect(senderId);
Expand Down
16 changes: 14 additions & 2 deletions afx-cefhud-interop/assets/examples/default/engine.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
this.indexSettings = {};

this.messageHandlers = {
"pong": async function(i){
console.log("PONG: "+i);
await Utils.toPromise(self.interop, "sendMessage", self.args.drawingInteropId, JSON.stringify({
"id": "ping",
"args": [i + 1]
}));
},
"settings": async function (settings) {
this.indexSettings = Object.assign({}, this.indexSettings, settings);
},
Expand All @@ -72,6 +79,11 @@
this.drawingConnectedEvent = null;
e[0]();
}
/*
await Utils.toPromise(self.interop, "sendMessage", self.args.drawingInteropId, JSON.stringify({
"id": "ping",
"args": [0]
}));*/
},
"drawingDisconnected": async function(senderId) {
console.log("drawingDisconnected: "+senderId);
Expand Down Expand Up @@ -387,8 +399,8 @@
"id": "engineConnected",
"args": [self.interop.id]
}));

await self.interop.onMessage(self.interop.id, JSON.stringify({
self.interop.onMessage(self.interop.id, JSON.stringify({
"id": "pump",
"args": []
}));
Expand Down
2 changes: 1 addition & 1 deletion afx-cefhud-interop/simple_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void SimpleApp::OnBeforeCommandLineProcessing(
command_line->AppendSwitch("disable-gpu-watchdog");
command_line->AppendSwitch("disable-hang-monitor");

//command_line->AppendSwitch("disable-frame-rate-limit"); // this will cause a hang / crash / memory leak in GPU process after a few minutes, but in Debug it will cause an exception, so ....
command_line->AppendSwitch("disable-frame-rate-limit");
command_line->AppendSwitchWithValue("deadline-to-synchronize-surfaces", "0");
//command_line->AppendSwitch("double-buffer-compositing");

Expand Down
2 changes: 1 addition & 1 deletion afx-cefhud-interop/simple_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ bool SimpleHandler::OnProcessMessageReceived(
return true;
} else if (name == "afx-paint") {
CefPostTask(TID_UI, new advancedfx::interop::CAfxTask([this, browser] {
browser->GetHost()->Invalidate(PET_VIEW);
browser->GetHost()->WasResized();
browser->GetHost()->SendExternalBeginFrame();
}));
} else if (name == "afx-use-clear") {
Expand Down

0 comments on commit 85f5277

Please sign in to comment.