Reorganization of data resources
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
Vendored
+1369
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
id ICON "icon.ico"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Gravit.io -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 48 48" width="48" height="48"><defs><clipPath id="_clipPath_oQOpAlaS5aQPNgwhNjsJr8QwgeI7VsJ1"><rect width="48" height="48"/></clipPath></defs><g clip-path="url(#_clipPath_oQOpAlaS5aQPNgwhNjsJr8QwgeI7VsJ1)"><rect width="48" height="48" style="fill:rgb(0,0,0)" fill-opacity="0"/><path d="M 4 0 L 44 0 C 46.208 0 48 1.792 48 4 L 48 44 C 48 46.208 46.208 48 44 48 L 4 48 C 1.792 48 0 46.208 0 44 L 0 4 C 0 1.792 1.792 0 4 0 Z" style="stroke:none;fill:#2E2E32;stroke-miterlimit:10;"/><path d=" M 19 27 L 19 15 C 19 13.896 18.104 13 17 13 L 13 13 L 13 30 C 13 32.76 15.24 35 18 35 L 35 35 L 35 31 C 35 29.896 34.104 29 33 29 L 21 29 C 19.896 29 19 28.104 19 27 Z " fill="rgb(225,225,230)"/><path d=" M 24 22 L 24 16 L 29 19 L 32 24 L 26 24 C 24.896 24 24 23.104 24 22 Z " fill="rgb(147,221,250)"/><path d=" M 35 13 L 21 13 L 35 27 L 35 13 Z " fill="rgb(255,169,77)"/><path d=" M 32 16 L 24 16 L 32 24 L 32 16 Z " fill="rgb(247,201,92)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Lite XL
|
||||
Comment=A lightweight text editor written in Lua
|
||||
Exec=lite %F
|
||||
Icon=lite-xl
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Categories=Utility;TextEditor;Development;
|
||||
MimeType=text/plain;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>lite-xl</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>lite-xl</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icon</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>lite-xl</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key><string>10.13</string>
|
||||
<key>NSDocumentsFolderUsageDescription</key><string>To access, edit and index your projects.</string>
|
||||
<key>NSDesktopFolderUsageDescription</key><string>To access, edit and index your projects.</string>
|
||||
<key>NSDownloadsFolderUsageDescription</key><string>To access, edit and index your projects.</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.16.10</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© 2019-2021 Francesco Abbate</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,97 @@
|
||||
## Window creation for Retina displays
|
||||
|
||||
The file info.plist sets NSHighResolutionCapable to true. This is fine for High-DPI
|
||||
and retina displays.
|
||||
|
||||
The `SDL_CreateWindow` is called with the flag `SDL_WINDOW_ALLOW_HIGHDPI`.
|
||||
On Mac OS it means that, in source file `video/cocoa/SDL_cocoawindow.m`, from
|
||||
function `Cocoa_CreateWindow`, SDL calls:
|
||||
|
||||
```objc
|
||||
/* highdpi will be TRUE below */
|
||||
BOOL highdpi = (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) != 0;
|
||||
[contentView setWantsBestResolutionOpenGLSurface:highdpi]
|
||||
```
|
||||
|
||||
Documentation for `setWantsBestResolutionOpenGLSurface`:
|
||||
|
||||
https://developer.apple.com/documentation/appkit/nsview/1414938-wantsbestresolutionopenglsurface
|
||||
|
||||
with more details in "OpenGL Programming Guide for Mac", chapter
|
||||
"Optimizing OpenGL for High Resolution":
|
||||
|
||||
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/EnablingOpenGLforHighResolution/EnablingOpenGLforHighResolution.html#//apple_ref/doc/uid/TP40001987-CH1001-SW4
|
||||
|
||||
Citation from the official documentation:
|
||||
|
||||
You can opt in to high resolution by calling the method
|
||||
`setWantsBestResolutionOpenGLSurface:` when you initialize the view, and
|
||||
supplying YES as an argument:
|
||||
|
||||
```objc
|
||||
[self setWantsBestResolutionOpenGLSurface:YES];
|
||||
```
|
||||
|
||||
If you don’t opt in, the system magnifies the rendered results.
|
||||
|
||||
The wantsBestResolutionOpenGLSurface property is relevant only for views to
|
||||
which an NSOpenGLContext object is bound. Its value does not affect the behavior
|
||||
of other views. For compatibility, wantsBestResolutionOpenGLSurface defaults to
|
||||
NO, providing a 1-pixel-per-point framebuffer regardless of the backing scale
|
||||
factor for the display the view occupies. Setting this property to YES for a
|
||||
given view causes AppKit to allocate a higher-resolution framebuffer when
|
||||
appropriate for the backing scale factor and target display.
|
||||
|
||||
To function correctly with wantsBestResolutionOpenGLSurface set to YES, a view
|
||||
must perform correct conversions between view units (points) and pixel units as
|
||||
needed. For example, the common practice of passing the width and height of
|
||||
[self bounds] to glViewport() will yield incorrect results at high resolution,
|
||||
because the parameters passed to the glViewport() function must be in pixels. As
|
||||
a result, you’ll get only partial instead of complete coverage of the render
|
||||
surface. Instead, use the backing store bounds:
|
||||
|
||||
```objc
|
||||
[self convertRectToBacking:[self bounds]];
|
||||
```
|
||||
|
||||
## Coordinates
|
||||
|
||||
The SDL function `SDL_GL_GetDrawableSize` will provide the size of the underlying drawable
|
||||
in pixels. From the `SDL_video.h` header.
|
||||
|
||||
```c
|
||||
/**
|
||||
* \brief Get the size of a window's underlying drawable in pixels (for use
|
||||
* with glViewport).
|
||||
*
|
||||
* \param window Window from which the drawable size should be queried
|
||||
* \param w Pointer to variable for storing the width in pixels, may be NULL
|
||||
* \param h Pointer to variable for storing the height in pixels, may be NULL
|
||||
*
|
||||
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
||||
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
|
||||
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
|
||||
* by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
|
||||
*
|
||||
* \sa SDL_GetWindowSize()
|
||||
* \sa SDL_CreateWindow()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
|
||||
int *h);
|
||||
```
|
||||
|
||||
In turns it calls `Cocoa_GL_GetDrawableSize` from source file
|
||||
`video/cocoa/SDL_cocoaopengl.m`. The function use the method
|
||||
`[contentView convertRectToBacking:viewport]`:
|
||||
|
||||
```objc
|
||||
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
|
||||
/* This gives us the correct viewport for a Retina-enabled view, only
|
||||
* supported on 10.7+. */
|
||||
if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
|
||||
viewport = [contentView convertRectToBacking:viewport];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
to give back the sizes in pixels.
|
||||
Reference in New Issue
Block a user