Commit 7c22bb38 authored by José Fonseca's avatar José Fonseca

gdi: Port of the gdi mesa driver to gallium (Alan Hourihane).

parent 6a39bcf3
#######################################################################
# SConscript for gdi winsys
Import('*')
if env['platform'] == 'windows':
env = env.Clone()
env.Append(CPPPATH = [
'#src/mesa/glapi',
'#src/mesa',
'#src/mesa/main',
])
sources = [
'opengl32.def',
'wgl.c',
'wmesa.c',
]
drivers = [
softpipe,
]
env.Append(LIBS = ['gdi32', 'user32'])
# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
env.SharedLibrary(
target ='opengl32',
source = sources,
LIBS = glapi + mesa + drivers + auxiliaries + env['LIBS'],
)
/* Values for wmesa->pixelformat: */
#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */
#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
#define PF_DITHER8 6 /* Dithered RGB using a lookup table */
#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */
#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */
#define PF_BADFORMAT 11
#define PF_INDEX8 12
#define BGR8(r,g,b) (unsigned)(((BYTE)((b & 0xc0) | ((g & 0xe0)>>2) | \
((r & 0xe0)>>5))))
/* Windows uses 5,5,5 for 16-bit */
#define BGR16(r,g,b) ( (((unsigned short)b ) >> 3) | \
(((unsigned short)g & 0xf8) << 2) | \
(((unsigned short)r & 0xf8) << 7) )
#define BGR24(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)| \
((WORD)((BYTE)(g))<<8))| \
(((DWORD)(BYTE)(r))<<16)))
#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)| \
((WORD)((BYTE)(g))<<8))| \
(((DWORD)(BYTE)(r))<<16)))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef WMESADEF_H
#define WMESADEF_H
#ifdef __MINGW32__
#include <windows.h>
#endif
#if 0
#include "context.h"
#endif
#include "state_tracker/st_context.h"
#include "state_tracker/st_public.h"
/**
* The Windows Mesa rendering context, derived from GLcontext.
*/
struct wmesa_context {
struct st_context *st;
HDC hDC;
BYTE cColorBits;
};
/**
* Windows framebuffer, derived from gl_framebuffer
*/
struct wmesa_framebuffer
{
struct st_framebuffer *stfb;
HDC hDC;
int pixelformat;
BYTE cColorBits;
HDC dib_hDC;
HBITMAP hbmDIB;
HBITMAP hOldBitmap;
PBYTE pbPixels;
struct wmesa_framebuffer *next;
};
typedef struct wmesa_framebuffer *WMesaFramebuffer;
#endif /* WMESADEF_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment