Giter Club home page Giter Club logo

centurion's People

Contributors

albin-johansson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

centurion's Issues

Utilize the Area struct more

Replace the occurrences of separate width and height parameters and use Dimension instead. It should probably be templated as well.

Experiment with letting renderers store fonts.

When dealing with rendering menus and other things that require a lot of text rendering, it's often the case that a bunch of fonts need to be used. Since renderers don't manage any fonts on their own, the desired fonts need to be sent alongside the renderer. Investigate if renderers could hold shared pointers that could be obtainable by name, for example.

Consider adding drawable string component

Consider adding a DrawableString component that will automatically recreate the associated texture whenever the string is updated. This could make it easier to render text that changes often. This is done with the font_cache class.

Update resources.

Move resources folder to tests, and check that they are CC0. Otherwise, give appropriate credit.

Move all documentation to GitBook.

  • Why use Centurion?
  • How to install Centurion.
  • Document all components
    • Battery
    • BlendMode
    • ButtonState
    • Centurion
    • CenturionException
    • Color
    • CPU
    • Cursor
    • Error
    • Font
    • Key
    • KeyState
    • Log
    • MessageBox (and its related stuff)
    • MouseState
    • Music
    • AppPath & PrefPath
    • PixelFormat
    • Platform
    • Point
    • RAM
    • Rect
    • Renderer
    • Screen
    • SoundEffect
    • Surface
    • Texture
    • TextureLoader
    • Timer
    • Window
    • All of the events

Change naming convention to be more Qt-like

Change to a property based system for designating getter and setter names, in the style of Qt. For example, if a class is said to have a width property, then the associated methods that you would expect are int width(); and int set_width(int width);.

Reconsider the new namespaces

Consider removing namespaces that aren't really necessary such as centurion::system. Too many namespaces makes usage of the library a bit of a nuisance.

Add `Input` class

This class should be a helper class that combines the features of MouseState and KeyState.

  • Provide the same API as MouseState
  • Provide the same API as KeyState.
  • The user shouldn't have to supply MouseState and KeyState instances in order to construct it.

Overhaul documentation.

  • Overhaul Doxygen documentation.
  • Create RtD documentation.
    • area
    • base_path
    • basic_joystick
    • basic_renderer
    • basic_window
    • battery
    • blend_mode
    • button_state
    • library, config
    • Clipboard
    • color
    • Color constants
    • condition
    • controller
    • Counter
    • CPU
    • cursor
    • Events
    • event_type
    • font
    • font_cache
    • Hints
    • joystick
    • joystick_handle
    • key_code
    • key_modifier
    • key_state
    • Logging
    • Message boxes
    • mouse_button
    • mouse_state
    • music
    • mutex
    • pixel_format
    • platform
    • Point
    • pref_path
    • RAM
    • Rect
    • renderer
    • renderer_handle
    • scale_mode
    • scan_code
    • scoped_lock
    • Screen
    • sdl_string
    • semaphore
    • sound_effect
    • surface
    • texture
    • texture_access
    • thread
    • Touch
    • try_lock
    • Types
    • unicode_string
    • Video
    • window
    • window_handle
    • Window Utilities

Add `SystemWMEvent`

This class wasn't included in the "Redesign event components" issue because its a bit of a nuisance to implement.

  • Add centurion::event::SystemWMEvent class.

Add Key related utilities

  • Add Key::Key(CZString) noexcept
  • Add std::string Key::name() const noexcept
  • Add bool Key::unknown() const noexcept for checking if the key has a good value.

Overhaul string usage

Overhaul the usage of std::string and const char* and review where their respective usage is appropriate. Replace usage of const char* with some sort of string view, e.g. using StringView = gsl::czstring_span;...

Migrate to C++20.

When C++20 becomes readily available and compilers have implemented most of the new features, Centurion should take advantage of these. These changes are breaking and will not allow for the current C++11, c++14 and C++17 compatibility. In other words, these features should be adapted in a new major release.

  • Migrate to modules.
  • Utilize concepts for template type restrictions.

Make Key lazily initialize its scancode/keycode.

Change Key to lazily initialize the internal scancode/keycode, since it's often sufficient to only use either scancodes or keycodes. This slightly improves performance when often creating Key instances.

Make Area struct templated.

  • Make Area struct templated, should allow integer and floating-point types like Rect and Point does.
  • Make sure to include using Area = Area<int> to keep backwards compatibility.

Update library to support SDL2 2.0.12

A new version of the core SDL2 library has been released, update the Centurion library to be up-to-date with the new features. https://www.reddit.com/r/sdl/comments/fgy7sa/sdl_2012_released/

  • SDL_GetTextureScaleMode() and SDL_SetTextureScaleMode() to get and set the scaling mode used for a texture.
  • SDL_LockTextureToSurface(), similar to SDL_LockTexture() but the locked area is exposed as a SDL surface.
  • New blend mode, SDL_BLENDMODE_MUL, which does a modulate and blend operation.
  • Added window underneath the finger to the SDL_TouchFingerEvent.
  • SDL_GameControllerTypeForIndex(), SDL_GameControllerGetType() to return the type of a game controller (Xbox 360, Xbox One, PS3, PS4, or Nintendo Switch Pro).
  • SDL_JoystickFromPlayerIndex() and SDL_GameControllerFromPlayerIndex() to get the device associated with a player index.
  • SDL_JoystickSetPlayerIndex() and SDL_GameControllerSetPlayerIndex() to set the player index associated with a device.
  • SDL_HasARMSIMD() which returns true if the CPU has ARM SIMD (ARMv6+) features.
  • Support for SDL_SetThreadPriority() for UWP applications.
  • SDL_GetAndroidSDKVersion() to return the API level of the current device.

Utilise string views for better performance

Since C++17, we have std::string_view as a very nice read-only handle to a raw C-style string, whilst still being able to use the read-only API of std::string. The library should use std::string_view every time a string isn't claimed, which can and will improve performance drastically due to eliminating the need for expensive copies and allocations when working with std::string. Naturally, this change would break the C++11 and C++14 compatibility.

Add handle versions of owning components

Add support for creating "handles" for components that don't actually own the associated resource.

  • window_handle
  • renderer_handle
  • joystick_handle
  • cursor_handle
  • surface_handle
  • texture_handle

Improve rendering API.

Improve the experience of using the Renderer class.

  • Expand and improve text rendering.

Improve Error class

  • Make it possible to create instances of the Error class, in order to be able to use member functions to query error messages together with a custom message.
  • Improve the API naming.
  • Error should be part of detail namespace.

Make binaries available for Linux

The library is usable on other systems that Windows if it's used in header-only mode. However, the header-only mode isn't very elegant and isn't the recommended way of using the library. Releases should feature compiled binaries for Linux, just as they've been for Windows.

Redesign event components.

  • AudioDeviceEvent
  • ControllerAxisEvent
  • ControllerButtonEvent
  • ControllerDeviceEvent
  • DollarGestureEvent
  • DropEvent
  • TouchFingerEvent
  • KeyboardEvent
  • JoyAxisEvent
  • JoyBallEvent
  • JoyHatEvent
  • JoyButtonEvent
  • JoyDeviceEvent
  • MouseMotionEvent
  • MouseButtonEvent
  • MouseWheelEvent
  • MultiGestureEvent
  • QuitEvent
  • SysWMEvent
  • TextEditingEvent
  • TextInputEvent
  • UserEvent?
  • WindowEvent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.