OpenTTD Source 20260129-master-g2bb01bd0e4
cocoa_v.mm File Reference

Code related to the cocoa video driver(s). More...

#include "../../stdafx.h"
#include "../../os/macosx/macos.h"
#include "../../os/macosx/macos_objective_c.h"
#include "../../openttd.h"
#include "../../debug.h"
#include "../../error_func.h"
#include "../../core/geometry_func.hpp"
#include "../../core/math_func.hpp"
#include "cocoa_v.h"
#include "cocoa_wnd.h"
#include "../../blitter/factory.hpp"
#include "../../framerate_type.h"
#include "../../gfx_func.h"
#include "../../thread.h"
#include "../../core/random_func.hpp"
#include "../../progress.h"
#include "../../settings_type.h"
#include "../../window_func.h"
#include "../../window_gui.h"
import <sys/param.h>
import <sys/time.h>

Go to the source code of this file.

Data Structures

class  OTTD_QuartzView
 Subclass of OTTD_CocoaView to fix Quartz rendering. More...
 

Functions

static void ClearWindowBuffer (uint32_t *buffer, uint32_t pitch, uint32_t height)
 Clear buffer to opaque black.
 

Variables

bool _cocoa_video_started = false
 Is the Cocoa video driver running.
 
static Palette _local_palette
 Current palette to use for drawing.
 
bool _tab_is_down
 Is tab button pressed.
 
static const Dimension _default_resolutions []
 List of common display/window sizes.
 
static FVideoDriver_CocoaQuartz iFVideoDriver_CocoaQuartz
 Register the cocoa video driver.
 

Detailed Description

Code related to the cocoa video driver(s).

Attention
Notice regarding all modifications!!!!!!! There are certain limitations because the file is objective C++. gdb has limitations. C++ and objective C code can't be joined in all cases (classes stuff). Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.

Definition in file cocoa_v.mm.

Function Documentation

◆ ClearWindowBuffer()

static void ClearWindowBuffer ( uint32_t *  buffer,
uint32_t  pitch,
uint32_t  height 
)
static

Clear buffer to opaque black.

Parameters
bufferPointer to the buffer.
pitchWidth of the buffer.
heightHeight of the buffer.

Definition at line 562 of file cocoa_v.mm.

Referenced by VideoDriver_CocoaQuartz::AllocateBackingStore().

Variable Documentation

◆ _cocoa_video_started

bool _cocoa_video_started = false

Is the Cocoa video driver running.

Definition at line 44 of file cocoa_v.mm.

Referenced by CocoaDialog(), VideoDriver_Cocoa::Initialize(), and VideoDriver_Cocoa::Stop().

◆ _default_resolutions

const Dimension _default_resolutions[]
static
Initial value:
= {
{ 640, 480 },
{ 800, 600 },
{ 1024, 768 },
{ 1152, 864 },
{ 1280, 800 },
{ 1280, 960 },
{ 1280, 1024 },
{ 1400, 1050 },
{ 1600, 1200 },
{ 1680, 1050 },
{ 1920, 1200 },
{ 2560, 1440 }
}

List of common display/window sizes.

Definition at line 50 of file cocoa_v.mm.

Referenced by VideoDriver_Cocoa::UpdateVideoModes().

◆ _local_palette

Palette _local_palette
static

Current palette to use for drawing.

Definition at line 45 of file cocoa_v.mm.

◆ _tab_is_down

bool _tab_is_down
extern

Is tab button pressed.

Definition at line 77 of file cocoa_wnd.mm.

Referenced by VideoDriver_Cocoa::InputLoop().

◆ iFVideoDriver_CocoaQuartz

FVideoDriver_CocoaQuartz iFVideoDriver_CocoaQuartz
static

Register the cocoa video driver.

Definition at line 554 of file cocoa_v.mm.