add width and height to clogframe params

This commit is contained in:
David Botton 2022-09-02 16:33:27 -04:00
parent 92381b366a
commit 9d82642b3c
4 changed files with 10 additions and 5 deletions

5
clogframe/README.md vendored
View file

@ -1,9 +1,10 @@
## CLOGFrame ## CLOGFrame
CLOG Frame uses the native browser control on your platform to create CLOG Frame uses the native browser control on your platform to create
a simple app the displays a 640x480 frame ready to recieve your app. a simple app the displays a frame ready to recieve your app.
clogframe[.exe] "Window Title" port clogframe[.exe] "Window Title" 8080 640 480
port w x h
in the clogframe directory run: in the clogframe directory run:

View file

@ -5,7 +5,7 @@
int main(int argc,char* argv[]) { int main(int argc,char* argv[]) {
webview::webview w(true, nullptr); webview::webview w(true, nullptr);
w.set_title(argv[1]); w.set_title(argv[1]);
w.set_size(640, 480, WEBVIEW_HINT_NONE); w.set_size(std::stoi(argv[3]), std::stoi(argv[4]), WEBVIEW_HINT_NONE);
std::ostringstream o; std::ostringstream o;
o << "http://127.0.0.1:" << argv[2]; o << "http://127.0.0.1:" << argv[2];
w.navigate(o.str()); w.navigate(o.str());

View file

@ -1 +1 @@
g++ clogframe.cpp -std=c++11 -Ilibs/webview $(pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0) -o clogframe c++ clogframe.cpp `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o clogframe

View file

@ -179,6 +179,7 @@
(start-game body) (start-game body)
;; When *app-mode* set only run the game once and then shutdown the app ;; When *app-mode* set only run the game once and then shutdown the app
(when *app-mode* (when *app-mode*
(sleep 2) ;; let end music play
(clog:shutdown) (clog:shutdown)
(uiop:quit))) (uiop:quit)))
@ -190,7 +191,10 @@
(when app (when app
(setf *app-mode* app)) (setf *app-mode* app))
(when clogframe (when clogframe
(uiop:run-program (list "./clogframe" "CLOG Snake" (format nil "~A" port)))) (uiop:run-program (list "./clogframe"
"CLOG Snake"
(format nil "~A" port)
(format nil "~A" 640) (format nil "~A" 420))))
(when start-browser (when start-browser
(format t "If browser does not start go to http://127.0.0.1:~A" port) (format t "If browser does not start go to http://127.0.0.1:~A" port)
(open-browser :url (format nil "http://127.0.0.1:~A" port)))) (open-browser :url (format nil "http://127.0.0.1:~A" port))))