Force hardware pixel format to 565.
[SDL.s60v3.git] / symbian / include / internal / epoc_sdl.h
blob326a11ed00c98be8abee9be7499da4252e443808
1 #ifndef EPOCSDL_H
2 #define EPOCSDL_H
4 #include <e32def.h>
5 #include <e32std.h>
6 #include <gdi.h>
7 #include <w32std.h>
8 #include <aknappui.h>
9 #include <queue>
10 #include "SDL_config_symbian.h"
12 #define PANIC(x) Panic(x, __LINE__)
13 #define PANIC_IF_ERROR(x) (x == KErrNone || Panic(x, __LINE__))
15 TInt Panic(TInt aErr, TInt aLine);
17 typedef void (*TSdlCleanupOperation) (void* aThis);
19 class CEventQueue
21 public:
22 void Append(const TWsEvent& aEvent) { m_queue.push(aEvent); }
23 const TWsEvent Shift();
24 bool HasData();
26 private:
27 std::queue<TWsEvent> m_queue;
30 class TSdlCleanupItem
32 public:
33 TSdlCleanupItem(TSdlCleanupOperation aOperation, void* aItem);
34 TSdlCleanupOperation iOperation;
35 void* iItem;
36 TThreadId iThread;
39 class EpocSdlEnv
41 public:
42 static bool IsDsaAvailable();
43 static TInt AllocSurface(const TSize& aSize, int bpp);
44 static void UnlockHwSurface();
45 static TUint8* LockHwSurface();
46 static void UpdateSwSurface();
47 static bool AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aTargetRect);
48 static TInt SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette);
49 static TInt AppendCleanupItem(const TSdlCleanupItem& aItem);
50 static void RemoveCleanupItem(void* aItem);
51 static void CleanupItems();
52 static void FreeSurface();
53 static TInt ApplyGlesDsa();
54 static RWindow* Window();
57 #endif