Added integration guide.
This commit is contained in:
parent
604fc2d463
commit
16fbfa2bda
@ -162,6 +162,7 @@
|
||||
<ClInclude Include="..\tb_renderer_gl.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\integration.txt" />
|
||||
<None Include="..\..\readme.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
@ -255,5 +255,8 @@
|
||||
<None Include="..\..\readme.txt">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="..\..\integration.txt">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
81
integration.txt
Normal file
81
integration.txt
Normal file
@ -0,0 +1,81 @@
|
||||
// ================================================================================
|
||||
// == This file is a part of Tinkerbell UI Toolkit. (C) 2011-2012, Emil Segerås ==
|
||||
// == See tinkerbell.h for more information and license. ==
|
||||
// ================================================================================
|
||||
|
||||
Tinkerbell Integration guide
|
||||
-----------------------------
|
||||
|
||||
This is a short guide to integrating tinkerbell in a game or application.
|
||||
It basically list what you most probably want to do.
|
||||
More defails is found in the method definitions.
|
||||
|
||||
Input
|
||||
-----
|
||||
|
||||
You need to create a "root widget" for your UI widgets. Just a widget that act
|
||||
as receiver for input, painting etc, and that contains all your other widgets.
|
||||
Tinkerbell will handle input capture, focus, etc. automatically.
|
||||
|
||||
List of input triggers:
|
||||
|
||||
root->InvokePointer[Down/Up/Move] - Mouse or touch input.
|
||||
root->InvokeWheel - Mouse wheel support
|
||||
root->InvokeKey - Keyboard input
|
||||
|
||||
Layout & Painting
|
||||
-----------------
|
||||
|
||||
Before painting, it is a good time to update widgets layouts and input states
|
||||
that might affect the rendering. This is done by calling:
|
||||
|
||||
root->InvokeProcess
|
||||
root->InvokeProcessStates
|
||||
|
||||
Before painting the root widget (and all its children), you need to prepare
|
||||
the renderer to set up the correct matrix etc.
|
||||
|
||||
g_renderer->BeginPaint(window_width, window_height);
|
||||
root->InvokePaint(Widget::PaintProps())
|
||||
g_renderer->EndPaint();
|
||||
|
||||
Message handling
|
||||
----------------
|
||||
|
||||
TBMessageHandler::ProcessMessages() needs to be called frequently to process
|
||||
the message queue.
|
||||
|
||||
If you have a game running its loop all the time, you can just call ProcessMessages()
|
||||
each time.
|
||||
|
||||
If you have a event driven application that should only consume CPU while needed
|
||||
you can call TBMessageHandler::GetNextMessageFireTime() for scheduleing when to run
|
||||
ProcessMessage next. Also, TBSystem::RescheduleTimer will be called back if the time
|
||||
it needs to run next is changed.
|
||||
|
||||
Rendering & font backend
|
||||
------------------------
|
||||
|
||||
There is already a OpenGL renderer implementation, using fixed function pipeline.
|
||||
The font system is also implemented in the renderer backend.
|
||||
|
||||
TBBitmap - FIX: write something here.
|
||||
TBRenderer - FIX: write something here. Write about fonts (+TDFont)
|
||||
|
||||
Some apps need to unload all graphics and reload it again, f.ex when the app
|
||||
is put to sleep in the background. Tinkerbell loads all its bitmaps through the skin,
|
||||
so unloading & reloading all textures can be done with:
|
||||
|
||||
TBSkin::UnloadBitmaps()
|
||||
TBSkin::ReloadBitmaps()
|
||||
|
||||
System integration
|
||||
------------------
|
||||
|
||||
TBImageLoader - FIX: write something here. (+TDImage)
|
||||
|
||||
TBSystem - Needs to be implemented for timers & some settings.
|
||||
|
||||
TBClipboard - Needs to be implemented for clipboard support.
|
||||
|
||||
TBFile - Needs to be implemented for file loading.
|
Loading…
Reference in New Issue
Block a user