Skip to content

Commit 6aa5ac2

Browse files
committed
- fix mac issues
1 parent ab944d4 commit 6aa5ac2

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ Temporary Items
3939
.apdisk
4040
build_config_user.json
4141
test_results/
42-
**/container.txt
43-
**.user.jsn
42+
**.user.jsn
43+
**.container.txt

core/pen/source/osx/os.mm

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
pen::pen_creation_params creation_params;
3636
NSWindow* window;
3737
bool terminate_app = false;
38+
s32 window_scale = 1;
3839
};
3940
os_context s_ctx;
4041

@@ -607,6 +608,9 @@ void pen_run_windowed(int argc, char** argv)
607608
[s_ctx.window setAcceptsMouseMovedEvents:YES];
608609
[s_ctx.window center];
609610
[s_ctx.window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil]];
611+
612+
s_ctx.window_scale = [s_ctx.window backingScaleFactor];
613+
610614
_update_window_frame();
611615

612616
// creates an opengl or metal rendering context
@@ -741,8 +745,8 @@ bool input_redo_pressed()
741745

742746
void window_get_size(s32& width, s32& height)
743747
{
744-
width = pen_window.width;
745-
height = pen_window.height;
748+
width = pen_window.width * s_ctx.window_scale;
749+
height = pen_window.height * s_ctx.window_scale;
746750
}
747751

748752
f32 window_get_aspect()

core/template/osx/Info.plist

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key></key>
6+
<string></string>
7+
<key>ATSApplicationFontsPath</key>
8+
<string>data/fonts</string>
9+
<key>CFBundleDevelopmentRegion</key>
10+
<string>$(DEVELOPMENT_LANGUAGE)</string>
11+
<key>CFBundleExecutable</key>
12+
<string>$(EXECUTABLE_NAME)</string>
13+
<key>CFBundleIconFile</key>
14+
<string></string>
15+
<key>CFBundleIdentifier</key>
16+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
17+
<key>CFBundleInfoDictionaryVersion</key>
18+
<string>6.0</string>
19+
<key>CFBundleName</key>
20+
<string>$(PRODUCT_NAME)</string>
21+
<key>CFBundlePackageType</key>
22+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
23+
<key>CFBundleShortVersionString</key>
24+
<string>1.0</string>
25+
<key>CFBundleVersion</key>
26+
<string>1</string>
27+
<key>LSMinimumSystemVersion</key>
28+
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
29+
<key>NSHighResolutionCapable</key>
30+
<false/>
31+
<key>NSPrincipalClass</key>
32+
<string>NSApplication</string>
33+
<key>NSSupportsAutomaticTermination</key>
34+
<true/>
35+
<key>NSSupportsSuddenTermination</key>
36+
<false/>
37+
</dict>
38+
</plist>

tools/premake/app_template.lua

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ local function setup_osx()
2424
}
2525
add_pmtech_links()
2626

27+
files
28+
{
29+
(pmtech_dir .. "core/template/osx/Info.plist")
30+
}
31+
2732
if _ACTION == "xcode4" then
2833
install_name_tool = "cd ../../bin/osx && install_name_tool -add_rpath @executable_path/../../.. "
2934
configuration "Debug"

0 commit comments

Comments
 (0)