da53685587Font class now can change its point-size on the fly - this obviously changes the 'state' of the Font, so subsequent draws will reflect the changes. This will likely not be a problem, as Text input will likely handle this by specifying size and color changes whenever a render operation is needed. Font also now holds the SDL_RWops object so that the font can be closed and re-opened at different sizes. Also added some minor comments in GUI.
master
kts
2015-03-09 16:40:10 -0700
b8d6462723Added basic code for creating and handling GUI events - at the moment just (SDL_USEREVENT + 10) using the SDL_USEREVENT union struct. Maybe define a custom struct that is equal in size to SDL_Event (and has type in the same position) and cast when needed? It'd make it a bit easier/nicer than using data1/data2. Cleaned up GuiElement and added margin functionality.
kts
2015-03-07 22:56:27 -0800
549b391c4eA magical commit occurs, wherein a much better GUI layout engine is implemented. Much shorter, much more logical, and much more expandable. Still needs some work as well as some tidying up.
kts
2015-03-07 04:07:29 -0800
8c2dfb042aAdded Program HashTable to core. Some delete/remove functionality added to various Render* classes. Gui/GuiList somewhat works. GUI is now specified in terms of (0,0) being at the top-left of the screen. Need to recode so GuiElement contains majority of the needed functionality for updating (and that even GuiList(s) contain proper positioning and sizing. Embedding elements in elements will be much easier and more functional if it's abstracted to the base class rather than a specific subclass.
kts
2015-03-06 21:39:07 -0800
1f0a4cdc53Updated OSX, iOS, and Android for SDL2_ttf.
kts
2015-03-06 14:13:11 -0800
1318be4fc0SDL_ttf now required. Added basic Font class and default TTF font (Amaranth).
kts
2015-03-06 05:53:09 -0800
482db6b6f1Updated VS project, works ok.
kts
2015-03-05 20:04:44 -0800
b3f9d3d0c8Updated linux build - moved getpwuid/etc. to SysInfo.
kts
2015-03-05 18:45:22 -0800
d4ea6ce4b0updated TODO. Gui system is as abominable as ever. Need to rework it so offset_x/offset_y contain the absolute x/y(maybe just rename to that) as created during doUpdate(). Added GuiButton/GuiList elements. The former is a basic button that (at the moment) relies on a textured image - will later have a text texture generated with SDL2_ttf. There now exists a SysInfo class, of which the global instance, sysinfo, is provided. This provides the app, user, and external data directories (still needs to be fully implemented). It also provides screen density DPI, xdpi, and ydpi, at least for Android. RenderObjects may now be shown/hidden.
kts
2015-03-05 17:11:11 -0800
27624848bdAdded much dodgy code. Fixed bug in Android wherein if AAsset directory did not exist, a close directory call was still made (thereby exploding everything). Added bad mojo for getting user paths for OS X and Linux (USER/Library/Application Support/RtB on OS X and HOME/.RtB/ on Linux). GLSL shaders now reside in their own directories for different versions (e.g., 'data/shaders/100/default_vs.glsl'). Core now supplies getTexture and getMesh functions - these do not yet account for additions to the Asset Caches or similar, as if they successfully load once, they'll forever reference that same object. Added lots of bad stuff to the GUI, including indecision. I want GUI elements to render to a special context so that you can easily have scrolled content (or, perhaps in the future, an embedded browser for embedding HTML content). At the moment it is unused, but a RenderView is created for each GuiElement created. Ideally this RenderView FBO would only be updated whenever a change occurs to the GuiElement, so as to not consume too much. Gui rendering does exist now, although it's prone to change. RenderViews can now be created with a predefined FBO - this sets the STATIC_FBO flag which indicates not to create nor destroy any framebuffers. Additionally, Core now provides a RenderView for the default window fbo, v_fbo. Something is also distinctly screwed up with the RenderCamera/matrix/etc. - I believe an incorrect transformation is happening at some point, as the face culling seems to be reversed.
kts
2015-03-05 03:13:25 -0800
12b2eed290Updated VS project - works fine, but probably does not copy over all the needed DLLs during build (zlib, etc.).
kts
2015-03-04 01:12:49 -0800
a3e703f8fcUpdated Linux build.
kts
2015-03-04 01:05:55 -0800
3c534a9b98SDL2_image is now used. OMesh::loadObj now ensures that UVs and normals are created equal to the # of vertices - this is not exactly right, as it simply zeros values that don't exist, but it's better than nothing. Vertex indexing should be implemented using GL_DRAW_ELEMENTS, but for now we'll deal. Default cube now generates proper normals and uvs attached to triangular faces. GLSL vertex shaders now flip the outputted fragment UV (1.0 - uv.t). The Texture class has been created which is responsible for turning some image format data into an OpenGL texture. It handles things similarly to Mesh, in that it first loads the data then has to be 'built'.
kts
2015-03-04 00:59:46 -0800
12020b1da4Updated VS
kts
2015-03-03 03:29:09 -0800
d1121245afUpdated linux build
kts
2015-03-03 03:26:21 -0800
f05725438dImplemented some of the GUI subsystem. Events are first passed through the GUI (should limit this to only particular events) before being sent to the top-most state. Later on, the GUI will be capable of locking the sending of particular events, such as motion or mousemove, if an element is currently focused/held. Basic GuiElement added. Each GuiElement may have children, each of which may have children in turn. The Gui will send getHit requests to the top-most/parent GuiElement, after which that GuiElement will send getHit requests down to its children and their children if need be. If a match is found, a pointer to that element is returned, otherwise NULL. More to be added, but hopefully the GUI system is robust enough - it tries to somewhat decouple from the state, in that elements do not have to have their lower level hit detection processed. There may be some oddities in the design that have yet to be discovered due to there being no visual front end (and the creation of RenderObjects for said visuals).
kts
2015-03-03 03:24:07 -0800
268cbb5a1fUpdate VS project - works fine as well.
kts
2015-03-02 20:13:43 -0800
8b93c18bd5Updated ios, osx, and android builds - all work fine.
kts
2015-03-02 20:08:00 -0800
a567769fcfCore now uses a state stack. States may be pushed on the stack with Core::pushState(State*) and popped off with Core::popState(). Pushing a state will trigger the old state's onCede(), push the state onto the stack, then call the new state's onInit(if DID_INIT is not set) then onRise(). Popping a state will trigger the top state's onCede and the previous state(if it exists)'s onRise. Core::doProcess now has a delta tickrate accumulator that ensures the world is processed at Core::tick_rate. Rendering is not capped to this tickrate, as doRender is called outside of the Event handling and state processing. Finally, functionality that was in Core for testing is now in TestState - it pushed onto the stack during Core::initSystem
kts
2015-03-02 19:58:35 -0800
685c28891eGUI Notes that were forgotten.
kts
2015-03-02 11:04:49 -0800
5b5a1276cfAdded more notes to GUI, with some specifics for icon requirements and how the basic view will be. Very terse at the moment. Added default asset cache locations for iOS: the app's resources/data folder and the app's Documents folder.
kts
2015-03-02 03:25:39 -0800
ba6d8e21c8Updated VS project for States and set header includes for src/ and src/states.
kts
2015-03-02 01:54:08 -0800
6f30b0a662Updated Linux makefile to include MenuState
kts
2015-03-02 01:45:45 -0800
0142296949Added State class and MenuState subclass. Notes added for GUI and STATES in root. iOS, OS X, android, and Linux build environments now use include directories for src/ and src/states. This is to prevent excessive clutter in the src/ directory - although some might say that point was passed long ago.
kts
2015-03-02 01:18:01 -0800
b1efc3ef74AssetCache works fine on Windows now. Need to reorganize AssetCache's _WIN32 preprocessor conditionals - it's pretty ugly.
kts
2015-03-01 17:25:19 -0800
a531be218cMoved one line of code for no real reason (stemming from foolishness involved with not cleaning the build)
kts
2015-03-01 16:54:21 -0800
6e0a0b3226ApkAssetCache now fully works. Unlike AssetCache, it does not build a cache by traversing the directory hierarchy - this is due to limits of how the Android assets archive works -, but rather adds to the cache on get/load requests. This is more inefficient, but it shouldn't be much of a consideration. Fixed preprocessor conditionals around loops to stop vi from exploding. Some minor code cleanup to remove warnings.
kts
2015-03-01 16:46:13 -0800
977af72999AssetCaches no longer keep all .CACHE entries. If an entry does not exist on the file system, it is not added to the cache. As a result of this, dud entries are cleared whenever the cache file is written to disk.
kts
2015-03-01 06:07:50 -0800
abf9b299b5Added Android Java JNI functions that set 'app' and 'ext' directories that correspond to the application data directory and the external storage app directory respectively. Shaders now use Assets. Assets no longer exist in a 'data/' directory within an AssetCache directory, but rather as their location relative to the root of the AssetCache directory. fileToMem now exists as a separate function to asset_fileToMem, as the old method does not quite fit the new AssetCache scheme. Windows version needs to be fixed to match this update. Android version needs proper Asset management via the ApkAssetCache class - this involves iterating through files in a JNI acceptable manner.
kts
2015-03-01 05:45:36 -0800
c5f013d693Updated Linux makefile. added <errno.h>, <sys/stat.h>, and <dirent.h> to AssetCache.cpp. Asset system works on Linux now. I also did A Bad Thing and replaced MAX_PATH with 1024. Also, VS allows for some majorly bad template code to be accepted.
kts
2015-03-01 02:44:28 -0800
bc831f05b0AssetManager/AssetCache system now mostly in place. AssetCache(s) create/read from a .CACHE file in the target directory. This file is human-readable and is the index for the cache. Each line contains the file's path, its checksum, and the filesize. This file is updated when the filesize of the file changes. Currently new files are found and added on start - to be added is a refresh function. Also to be added is an update via modification time - this will require a new entry in the cache index file. A single-line version heading should also be added.
kts
2015-03-01 02:17:12 -0800
05a43ddcdbUpdated iOS, OSX, and Android projects
kts
2015-02-28 14:43:09 -0800
7cc5ad8df4Added the AssetCache class skeleton.
kts
2015-02-28 03:08:47 -0800
aeaeae02b8Actual update of Asset.cpp
kts
2015-02-27 19:57:06 -0800
b8ac063da1Updated Linux makefile. Added stdlib.h to Asset.cpp for free()
kts
2015-02-27 19:56:32 -0800
e1d908ae3eAdded basic AssetManager class skeleton. This will be the governing class for the loading of files and ensuring data remains the same between clients via checksum comparisons.
kts
2015-02-27 19:49:24 -0800
0ceb4b828dAdded/updated test code for mouse rotation, zooming, and panning.
kts
2015-02-25 15:56:25 -0800
8c37edcfe7Added some test code in Core that allow for pinch zooming and two-finger rotation.
kts
2015-02-25 07:51:10 -0800
00d0ec1c00Added cube model for testing. Shader textures now start at index 0 rather than 1. Things work on iOS now. closeSystem deletes gl context and destroys window - needs to free textures, etc. still. Added testing finger and mouse motion control. Meshes now generate uv buffer object and normals buffer object. RenderCamera now supports rendering in orthogonal as well as perspective. Orthogonal rendering relies on 'size' float, which indicates the vertical 3D units shown on screen. This is, for RtB, equal to 1 meter. Perspective rendering uses fov_angle, which is the vertical field of view angle. This is, default, pi / 4. Screen resizing now works fine on Android - recreated buffer used non gles type. RenderView now uses nearest mag/min filters rather than linear. Added handleAppEvents which is intended to deal with state changes on mobile devices, such as app minimizing. At the moment, core.closeSystem is called when RtB enters the background.
kts
2015-02-25 04:05:59 -0800
561c33f092Updated VS project. Added a _WIN32 ifdef and typedefs for uint32_t and uint8_t due to Windows not including inttypes.h.
kts
2015-02-24 17:18:40 -0800
b19f0bb727Updated Linux build, forgot to set v_flags to opengl/resizable. Core now calls updateProjection for each camera and setView for each camera's RenderView on window resize. This functionality will be moved elsewhere, as we do not necessarily want to resize the view or the camera to the entire window.
kts
2015-02-24 17:11:52 -0800
a0eeec21b2Much added. Basic asset access functions using fopen() techniques. Currently the system attempts to load from the CWD on most platforms, but on Android it attempts to load from the assets archive. Once updated, it will likely attempt to load from at least 3 locations before falling back to the built-in application assets (external device, user directory, application data directory). Creation/Loading of RtB is now managed by a Core class. This class is, to some extent, a service locator combined with larger engine functionality. A global instance of the class is provided as 'core'. It is responsible for updating the yet-to-be-added States, the base rendering, and the management of assets and much more.
kts
2015-02-24 16:55:11 -0800
adcf6cd1b5Added test chest model and basic model rendering shader. Mesh now builds normals buffer along with uv and vp. Added Quaternion class, currently used for RenderObject's rotation matrix generation - needs to be added to RenderCamera. RenderScene now accomplishes what its name implies - the rendering of a scene. Some logic needs to be moved into Program from RenderScene's doRender function.
kts
2015-02-23 02:49:52 -0800
07cecebad0Added a single comment. That is all.
kts
2015-02-22 00:14:48 -0800
b7e867fbf2Updates VS project. Replaced snprintf with std::ostringstream in Program::attachTexture. Added RenderCamera functionality for orientation and position. Much more to be added, but likely need to implement the State machine so majority of the program logic is complete.
kts
2015-02-21 05:53:40 -0800
082828465cAdded Program class - it is responsible for loading and compiling GLSL shaders into a GLSL program. Much to be changed in regards to its functionality, especially Variable/Texture-related access. Rendering to FBO and displaying via a framebuffer shader works.
kts
2015-02-20 19:48:24 -0800
8b11fd78f3Re-added VAO code to mesh building, hopefully to no error.
kts
2015-02-13 15:12:26 -0800
f8758111dcUpdated android, ios, and osx projects. Hopefully nothing is broken.
kts
2015-02-12 07:40:40 -0800
9ab5b42752Added common checks for GLEW on Windows, need to fix and add other systems. Added LOG_INFO to logging, ERROR logs show SDL message box, and pointing logHook to a function taking 2 const char* params will call said function on log. Added Mesh type that can load an OBJ mesh and build OpenGL vbo/vao. Can also build from passed vertices, uv, and normal arrays. RenderCamera updated. RenderObject updated with Mesh member. RenderScene updated with basic rendering system set (renderTo(RenderView*)). RenderView now creates framebuffers and should be working. RenderView also relies on a Mesh that should generally be a quad, but is not necessarily (it uses a Mesh).
kts
2015-02-12 05:48:10 -0800
28d93f69d3Updated linux Makefile.
kts
2015-02-11 02:31:21 -0800
f7acf3c219Added a basic Logging system. Currently calls SDL_ShowSimpleMessageBox(...).
kts
2015-02-11 01:58:43 -0800
30d4b87298Updated ios and osx projects. Added some RenderCamera logic to RenderScene. Also added some basic code to main to test Render* functionality before the State machine is implemented.
kts
2015-02-10 21:44:05 -0800
1fa87fb90fImported Mat4 class from CC.
kts
2015-02-10 05:34:58 -0800
66eb0364b3Updated VS and added Vec2/Vec3/Vec3 classes from CC project. Also added RenderObject skeleton.
kts
2015-02-10 04:50:17 -0800
710712f8c1Moved GL.hpp to a common.hpp. common.hpp provides includes for SDL2 and OpenGL(ES) and should be included in any file that wishes to access types or functionality provided by either.
kts
2015-02-10 01:09:39 -0800
47ca485855Added RenderScene and RenderSet class skeletons. Also updated VS project.
kts
2015-02-09 21:32:27 -0800
4d05013cdcAdded RenderCamera and RenderView class skeletons. Also added a common GL header file.
kts
2015-02-09 18:29:12 -0800
3a2d9e3dcbBasic Linux make build environment. DRequires some modification to work on a fresh system -- instructions to be added at a later date.
kts
2015-02-04 16:56:01 -0800
b81a275456Added working Visual Studio Express 2012 project file.
kts
2015-02-04 16:28:22 -0800
750791f823Initial commit of RtB skeleton. ios, osx, and android build environments exist and successfully compile, presuming a fully functional SDL2 build environment. Documentation on getting such an environment set up will be forthcoming.
kts
2015-02-04 15:26:15 -0800