Subversion Repositories Games.Carmageddon

Rev

Rev 1 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
#ifndef HARNESS_HOOKS_H
2
#define HARNESS_HOOKS_H
3
 
18 pmbaty 4
#include "brender.h"
1 pmbaty 5
#include "harness/win95_polyfill_defs.h"
6
#include <stdio.h>
7
 
8
typedef enum {
9
    eFlush_all,
10
    eFlush_color_buffer
11
} tRenderer_flush_type;
12
 
13
// Platform implementation functions
14
typedef struct tHarness_platform {
15
    // Render a fullscreen quad using the specified pixel data
18 pmbaty 16
    void (*Renderer_Present)(br_pixelmap* src);
1 pmbaty 17
    // Set the 256 color palette to use (BGRA format)
18
    void (*Renderer_SetPalette)(PALETTEENTRY_* palette);
19
    // Create a window. Return a handle to the window
20
    void* (*CreateWindowAndRenderer)(char* title, int x, int y, int nWidth, int nHeight);
21
    // Get mouse button state
22
    int (*GetMouseButtons)(int* button_1, int* button_2);
23
    // Get mouse position
24
    int (*GetMousePosition)(int* pX, int* pY);
25
    // Close specified window
26
    void (*DestroyWindow)(void* window);
27
    // Process window messages, return any WM_QUIT message
28
    int (*ProcessWindowMessages)(MSG_* msg);
29
    // Set position of a window
30
    int (*SetWindowPos)(void* hWnd, int x, int y, int nWidth, int nHeight);
31
    // Show/hide the cursor
32
    int (*ShowCursor)(int show);
33
    // Get keyboard state. Expected to be in DirectInput key codes
34
    void (*GetKeyboardState)(unsigned int count, uint8_t* buffer);
35
    // Sleep
36
    void (*Sleep)(uint32_t dwMilliseconds);
37
    // Get ticks
38
    uint32_t (*GetTicks)(void);
39
    // Show error message
40
    int (*ShowErrorMessage)(void* window, char* text, char* caption);
41
 
42
} tHarness_platform;
43
 
44
extern tHarness_platform gHarness_platform;
45
 
46
void Harness_Init(int* argc, char* argv[]);
47
 
48
// Hooks are called from original game code.
49
 
50
// Filesystem hooks
51
FILE* Harness_Hook_fopen(const char* pathname, const char* mode);
52
 
53
#endif