Commit Graph

47 Commits (12020b1da418cc86ddc22ac9e0c87f490eaa771f)

Author SHA1 Message Date
kts 12020b1da4 Updated VS 2015-03-03 03:29:09 -08:00
kts d1121245af Updated linux build 2015-03-03 03:26:21 -08:00
kts f05725438d Implemented 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). 2015-03-03 03:24:07 -08:00
kts 268cbb5a1f Update VS project - works fine as well. 2015-03-02 20:13:43 -08:00
kts 8b93c18bd5 Updated ios, osx, and android builds - all work fine. 2015-03-02 20:08:00 -08:00
kts a567769fcf Core 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 2015-03-02 19:58:35 -08:00
kts 685c28891e GUI Notes that were forgotten. 2015-03-02 11:04:49 -08:00
kts 5b5a1276cf Added 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. 2015-03-02 03:25:39 -08:00
kts ba6d8e21c8 Updated VS project for States and set header includes for src/ and src/states. 2015-03-02 01:54:08 -08:00
kts 6f30b0a662 Updated Linux makefile to include MenuState 2015-03-02 01:45:45 -08:00
kts 0142296949 Added 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. 2015-03-02 01:18:01 -08:00
kts b1efc3ef74 AssetCache works fine on Windows now. Need to reorganize AssetCache's _WIN32 preprocessor conditionals - it's pretty ugly. 2015-03-01 17:25:19 -08:00
kts a531be218c Moved one line of code for no real reason (stemming from foolishness involved with not cleaning the build) 2015-03-01 16:54:21 -08:00
kts 6e0a0b3226 ApkAssetCache 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. 2015-03-01 16:46:13 -08:00
kts 977af72999 AssetCaches 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. 2015-03-01 06:07:50 -08:00
kts abf9b299b5 Added 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. 2015-03-01 05:45:36 -08:00
kts c5f013d693 Updated 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. 2015-03-01 02:44:28 -08:00
kts bc831f05b0 AssetManager/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.
Data files are now loaded from the Cache - Mesh and Program build from passed buffers now. These are generally read from a loaded Asset. Next up: updating it to work on Linux, Android, iOS, and OS X.

Also added a somewhat poor HashTable template implementation. Works okay, but might not be the best.
2015-03-01 02:17:12 -08:00
kts 05a43ddcdb Updated iOS, OSX, and Android projects 2015-02-28 14:43:09 -08:00
kts 7cc5ad8df4 Added the AssetCache class skeleton. 2015-02-28 03:08:47 -08:00
kts aeaeae02b8 Actual update of Asset.cpp 2015-02-27 19:57:06 -08:00
kts b8ac063da1 Updated Linux makefile. Added stdlib.h to Asset.cpp for free() 2015-02-27 19:56:32 -08:00
kts e1d908ae3e Added 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. 2015-02-27 19:49:24 -08:00
kts 0ceb4b828d Added/updated test code for mouse rotation, zooming, and panning. 2015-02-25 15:56:25 -08:00
kts 8c37edcfe7 Added some test code in Core that allow for pinch zooming and two-finger rotation. 2015-02-25 07:51:10 -08:00
kts 00d0ec1c00 Added 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. 2015-02-25 04:05:59 -08:00
kts 561c33f092 Updated VS project. Added a _WIN32 ifdef and typedefs for uint32_t and uint8_t due to Windows not including inttypes.h. 2015-02-24 17:18:40 -08:00
kts b19f0bb727 Updated 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. 2015-02-24 17:11:52 -08:00
kts a0eeec21b2 Much 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. 2015-02-24 16:55:11 -08:00
kts adcf6cd1b5 Added 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. 2015-02-23 02:49:52 -08:00
kts 07cecebad0 Added a single comment. That is all. 2015-02-22 00:14:48 -08:00
kts b7e867fbf2 Updates 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. 2015-02-21 05:53:40 -08:00
kts 082828465c Added 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. 2015-02-20 19:48:24 -08:00
kts 8b11fd78f3 Re-added VAO code to mesh building, hopefully to no error. 2015-02-13 15:12:26 -08:00
kts f8758111dc Updated android, ios, and osx projects. Hopefully nothing is broken. 2015-02-12 07:40:40 -08:00
kts 9ab5b42752 Added 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). 2015-02-12 05:48:10 -08:00
kts 28d93f69d3 Updated linux Makefile. 2015-02-11 02:31:21 -08:00
kts f7acf3c219 Added a basic Logging system. Currently calls SDL_ShowSimpleMessageBox(...). 2015-02-11 01:58:43 -08:00
kts 30d4b87298 Updated 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. 2015-02-10 21:44:05 -08:00
kts 1fa87fb90f Imported Mat4 class from CC. 2015-02-10 05:34:58 -08:00
kts 66eb0364b3 Updated VS and added Vec2/Vec3/Vec3 classes from CC project. Also added RenderObject skeleton. 2015-02-10 04:50:31 -08:00
kts 710712f8c1 Moved 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. 2015-02-10 01:09:39 -08:00
kts 47ca485855 Added RenderScene and RenderSet class skeletons. Also updated VS project. 2015-02-09 21:32:27 -08:00
kts 4d05013cdc Added RenderCamera and RenderView class skeletons. Also added a common GL header file. 2015-02-09 18:29:12 -08:00
kts 3a2d9e3dcb Basic Linux make build environment. DRequires some modification to work on a fresh system -- instructions to be added at a later date. 2015-02-04 16:56:01 -08:00
kts b81a275456 Added working Visual Studio Express 2012 project file. 2015-02-04 16:28:22 -08:00
kts 750791f823 Initial 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. 2015-02-04 15:26:15 -08:00