Windows 64
The Windows 64-bit port is the main development target for LCE. It lives in Minecraft.Client/Windows64/ and provides a full PC implementation using Direct3D 11 for rendering and Winsock2 for networking.
Key Files
Section titled “Key Files”| File | Purpose |
|---|---|
Windows64_App.h/.cpp | CConsoleMinecraftApp application class |
Windows64_Minecraft.cpp | Entry point (WinMain), main game loop |
Windows64_UIController.h/.cpp | ConsoleUIController with Iggy-based UI |
Windows64_PostProcess.h/.cpp | Gamma correction post-process shader |
Network/WinsockNetLayer.h/.cpp | TCP/UDP LAN networking layer |
Leaderboards/WindowsLeaderboardManager.h/.cpp | Leaderboard stub |
Minecraft_Macros.h | Slot display and skin bitmask packing macros |
4JLibs/inc/4J_Render.h | C4JRender class, Direct3D 11 rendering abstraction |
4JLibs/inc/4J_Input.h | C_4JInput class, gamepad/keyboard input |
4JLibs/inc/4J_Storage.h | C4JStorage class, filesystem save/load |
4JLibs/inc/4J_Profile.h | Profile management |
KeyboardMouseInput.h/.cpp | Full keyboard and mouse input class (MinecraftConsoles) |
Windows64_Xuid.h | Persistent player UID system with uid.dat (MinecraftConsoles) |
PostProcesser.cpp | Post-process implementation (MinecraftConsoles) |
Application Class
Section titled “Application Class”CConsoleMinecraftApp inherits from CMinecraftApp and provides a minimal implementation for PC. It handles:
- Thumbnail capture (
m_ThumbnailBufferof typeImageFileBuffer) - TMS file loading (local filesystem)
- Stub implementations for console-specific features (banned list, string table returns
NULL)
Entry Point and Main Loop
Section titled “Entry Point and Main Loop”Windows64_Minecraft.cpp defines the Win32 entry point. The startup sequence:
- Parse command-line arguments for username, resolution, and multiplayer options
- Create the Win32 window with
CreateWindowEx - Initialize Direct3D 11 device and swap chain
- Initialize
RenderManager,InputManager,ProfileManager,StorageManager - Define gamepad action mappings (
DefineActions), same Xbox 360 button layout - Initialize thread-local storage for
Tesselator,AABB,Vec3,IntCache,Compression - Call
Minecraft::main()to set up the game instance - Run the intro sequence, then enter the main game loop
The main loop processes input, profiles, storage, rendering, sound, network ticks, and UI (Iggy) rendering each frame.
Global configuration:
- Default resolution: 1920x1080 (
g_iScreenWidth,g_iScreenHeight) - Username stored in
g_Win64Username(max 16 characters)
Rendering
Section titled “Rendering”Uses Direct3D 11 through the C4JRender abstraction in 4JLibs/inc/4J_Render.h. The render manager provides an OpenGL-style API with constants like GL_SRC_ALPHA, GL_DEPTH_BUFFER_BIT, etc., mapped to D3D11 equivalents.
Key rendering features:
- Matrix stack (modelview, projection, texture)
- Command buffer system for batched rendering (
CBuffCreate,CBuffStart,CBuffCall) - Texture management with create/bind/data upload
- Splitscreen viewport support (fullscreen, 2-way split, 4-way quadrants)
- Conditional rendering with survey/query system
A dedicated post-process pass handles gamma correction via Windows64_PostProcess.h:
bool InitGammaPostProcess();void ApplyGammaPostProcess();void SetGammaValue(float gamma);Input Handling
Section titled “Input Handling”C_4JInput (the InputManager singleton) provides:
- Gamepad support with Xbox 360-style button constants (
_360_JOY_BUTTON_A, etc.) - Three control schemes (MAP_STYLE_0, MAP_STYLE_1, MAP_STYLE_2) for remappable layouts
- Analog stick access with deadzone and sensitivity settings
- Key repeat rate configuration
- Keyboard input dialog (
RequestKeyboard) with multiple modes (default, numeric, password, alphabet, IP address) - String verification against offensive word lists (TCR 092 compliance)
- Southpaw and swap-triggers axis remapping
The Windows 64 port also includes KeyboardMouseInput for PC-native keyboard and mouse controls.
Networking
Section titled “Networking”The WinsockNetLayer class provides a custom TCP-based networking layer with LAN discovery:
Connection Model
Section titled “Connection Model”- Host: Listens on a configurable port (default
25565) and accepts TCP connections via a dedicated accept thread - Client: Connects to a host via IP/port
- Max clients: 7 (
WIN64_NET_MAX_CLIENTS), max packet size 3 MB
Player Identification
Section titled “Player Identification”Each connected player gets a smallId (single byte) for efficient addressing. The layer supports:
SendToSmallIdfor sending data to a specific playerPopPendingJoinSmallId/PopDisconnectedSmallIdfor tracking join/leave events- Thread-safe connection management with per-connection
CRITICAL_SECTIONlocks
LAN Discovery
Section titled “LAN Discovery”UDP broadcast on port 25566 (WIN64_LAN_DISCOVERY_PORT) with a Win64LANBroadcast packet containing:
- Magic number
0x4D434C4E(“MCLN”) - Net version, game port, host name
- Player count, max players, game settings
- Texture pack IDs, joinability flag, dedicated server flag
- Player names (up to 8 slots)
Discovery runs on a separate thread and returns Win64LANSession structs via GetDiscoveredSessions().
Multiplayer Globals
Section titled “Multiplayer Globals”extern bool g_Win64MultiplayerHost;extern bool g_Win64MultiplayerJoin;extern int g_Win64MultiplayerPort;extern char g_Win64MultiplayerIP[256];UI Controller
Section titled “UI Controller”ConsoleUIController inherits from UIController (Iggy-based) and provides Direct3D 11-specific rendering:
- Initialized with
ID3D11Device,ID3D11DeviceContext, render target view, and depth stencil view - Custom draw callbacks for Iggy regions (
beginIggyCustomDraw4J,setupCustomDraw,endCustomDraw) - Texture substitution support (
getSubstitutionTexture,destroySubstitutionTexture)
Storage
Section titled “Storage”Uses filesystem-based storage through C4JStorage. Save data is stored as local files. The SAVE_INFO struct contains UTF-8 filenames, titles, metadata (modification time, data size, thumbnail size), and thumbnail data.
Unique Platform Features
Section titled “Unique Platform Features”- Keyboard and mouse input: Full
KeyboardMouseInputclass for PC controls alongside gamepad - Windowed mode: Win32 window creation with configurable resolution
- Post-process gamma: Shader-based gamma correction since Windows doesn’t provide system-level gamma like consoles do
- No DRM/commerce: Simplified app class without storefront integration
- Command-line multiplayer: Can specify host/join via command-line globals
MinecraftConsoles Additions
Section titled “MinecraftConsoles Additions”The MinecraftConsoles codebase adds several files to the Windows 64 platform that were not in LCEMP.
KeyboardMouseInput Class
Section titled “KeyboardMouseInput Class”KeyboardMouseInput.h/.cpp provides a full keyboard and mouse input system for PC-native controls. This runs alongside the gamepad input and supports:
- 256 virtual key tracking with per-frame press/release detection
- 3 mouse buttons (left, right, middle) with press/release detection
- Raw mouse delta for low-latency mouse look via
ConsumeMouseDelta() - Mouse grab mode for locking the cursor to the game window
- Text input buffering with
OnChar()/ConsumeChar()for keyboard scenes - Mouse wheel accumulator with consumption tracking
- KBM active flag to switch between gamepad and keyboard/mouse mode
- WASD movement with dedicated key constants (
KEY_FORWARD = 'W',KEY_BACKWARD = 'S',KEY_LEFT = 'A',KEY_RIGHT = 'D') - Standard PC bindings: Space = jump, LShift = sneak, Ctrl = sprint, E = inventory, Q = drop, C/R = crafting, F5 = third person, F3 = debug info, F4 = debug menu
Persistent Player UID (Windows64_Xuid.h)
Section titled “Persistent Player UID (Windows64_Xuid.h)”MinecraftConsoles adds a persistent player identity system for Windows 64 via Windows64_Xuid.h. In LCEMP, player UIDs were ephemeral (based on a hardcoded base value plus the small ID). MinecraftConsoles generates a random UID and stores it in a uid.dat file next to the executable.
Key functions:
GetLegacyEmbeddedBaseXuid()returns the old LCEMP base value (0xe000d45248242f2e)IsLegacyEmbeddedRange(xuid)detects old-style non-persistent UIDsIsPersistedUidValid(xuid)validates that a UID is not legacy and not invalidBuildUidFilePath()constructs the path touid.datrelative to the executableReadUid()/WriteUid()handle loading and saving the persistent UIDGenerateRandomXuid()creates a new random UID if none exists
This means worlds saved on MinecraftConsoles can track player ownership across sessions, while LCEMP worlds could not.
Iggy and Third-Party Libraries
Section titled “Iggy and Third-Party Libraries”MinecraftConsoles bundles the Iggy UI library source directly under Windows64/Iggy/:
gdraw/gdraw_d3d.cpp/.h(Direct3D 9 backend)gdraw/gdraw_d3d10.cpp/.h(Direct3D 10 backend)gdraw/gdraw_d3d11.cpp/.h(Direct3D 11 backend)gdraw/gdraw_wgl.h(OpenGL WGL backend)include/iggy.h,include/gdraw.h,include/iggyexpruntime.h,include/iggyperfmon.h,include/rrCore.h
The Sentient telemetry SDK is also bundled under Windows64/Sentient/ with configuration headers for analytics tracking.