Fixed compile errors with shader programs on some OpenGL versions.
Fixed the window title error. Now it appears fine.
Added WindowClass::register_indirect
, WindowBackgroundSystemColour
and WindowBackgroundColour
to WinCore
for the window_class
module.
Updated Background
: added the SystemColour
option, renamed Colour
to RGBColour
.
Fixed feature errors. Removed the windowing
feature.
Added docs configurations with the nightly-docs
feature.
Some changes for future updates.
New functions:
create
- called when an application requests that a window be createdclose_request
- called as a signal that a window or an application should terminatedestroy
- called when a window is being destroyed, after the window is removed from the screenset_cursor
- called if the mouse causes the cursor to move within a window and mouse input is not captured (theset_cursor_event
feature)resized
- called after window's size has changedmoved
- called after a window has been movedcatch_panic
- called when one of the functions above panics andcatch_unwind
catches the panic inWndProc
WindowProcedure::render
topaint
DrawParameters
fromGraphics
toDrawParameters2D
GCore
toGLCore
- the
AppWindowProcedure
trait - wrapsWindowProcedure
- the
set_cursor_event
feature for handling set cursor events - the
InstanceHandle
,WindowClassInfo
structs - cursor, brush, icon raw functions for Windows (
WinCore
) - the
CursorIcon::System
enumetion, it contains the system defined cursor - the
DrawParameters
struct toGLCore
- the
GraphicsCore::flush
function
CursorIcon::None
now doesn't set any cursor, use it for dynamic changing the cursor icon.
In that case use Cursor::set
to set the cursor
The quit
function has got an argument.
Drawing heap objects is safe. It doesn't panic if you set a wrong object id.
All objects with zero vertices are ignored, you can't add or push any.
Also ids returned by add_heap_object
start from zero.
WindowHandle
as a replacment forHWND
DeviceContextHandle
as a replacment forHDC
andDeviceContext
toWinCore
Cursor
toWinCore
BitmapHandle
as a replacment forHBITMAP
andBitmap
toWinCore
WindowClassStyles
for easily setting the class stylesWindowStyle
,WindowStyles
,ExtendedWindowStyle
,ExtendedWindowStyles
for easily setting the window stylesWindow::show_window
andShowCommand
toWinCore
Window::client_to_screen
,Window::screen_to_client
toWinCore
- a
WindowProcedure::render
function - all the GL
Buffer
functions that are available for OpenGL 3.3 toGLCore
Redraw
fromWindowEvent
.- the
VK
prefix fromVirtualKeyCode
.
Fixed CachedFont::text_size
and CachedFont::text_width
functions.
Now Graphics::draw_char
set a horisontal advance of any given character.
All the App
functions takes it as a reference, removed some, renamed the rest.
All the texture functions except basement::graphics::core
ones now returns GLError
.
Removed CatAudio
from the default features.
Added wrappers for drawing functions (graphics::level0
).
Texture
and Buffer
write functions from graphics::level0
are now just wrappers.
All the buffer functions except basement::graphics::core
ones returns GLError
.
Added new features - support
(enables the support module) and windowing
(enables).
Fixed the Texture::write_image
and Texture::rewrite_image
functions.
Added FontError
for the FontOwner::load
function.
Renamed and removed some glyphs structures. Removed unnecessary functions.
Now the Graphics::draw_char
function scale characters relative to the original size.
Later scaling was relative to glyph's current size,
so dynamically build and textured glyphs had different initial sizes.
Removed all the events to the windows
module.
Now some posted to the thread messages are also handled with EventLoop
.
The messages:
WindowEvent::KeyPress
,WindowEvent::KeyRelease
WindowEvent::CharacterInput
WindowEvent::MouseMove
,WindowEvent::MousePress
,WindowEvent::MouseRelease
,WindowEvent::MouseScroll
Added core::texture::Texture::wrap_s
, -::wrap_t
and -::wrap_r
functions.
Updated the ttf-parser
crate to 0.12.3
and the minimp3
crate to 0.5.1
.
- new formats for
Texture2DInternalFormat
andImageDataFormat
core::window::Window::get_window_long_ptr
and-::set_window_long_ptr
functions andWindowData
for themWindowClass
tocore
- a
VertexIntegerComponents
enum for thecore::vertex_array::VertexArray::attribute_pointer
function - a
core::vertex_array::VertexArray::attribute_pointer_integer
function andVertexIntegerComponents
andIntegerDataType
for it - a
Seconds
option forEventInterval
ImageDataFormat
and ImageDataType
are merged into ImageDataFormat
.
WindowsCore
. It wraps nessesary Windows API functions- an
opengl
feature. It enables using wrapped GL functions and context Window::set_fullscreen
andWindow::show_cursor
functions- a
vsync
field forOpenGLRenderContextAttributes
, but other fields are removed - an
auto_redraw
flag that defines whether a new redraw event is requested directly after processing the last one. To set the flag useWindow::set_auto_redraw
- a fps lock,
EventLoop
controls frame rate, but you need to disableauto_redraw
and vsync (OpenGLRenderContext::set_vsync
) - an ability to disable update and redraw events and without changing the
LoopControl
flag. Just set an event rate to zero:EventInterval::EventsPerSecond(0)
,EventInterval::Ticks(0)
orEventInterval::NanoSeconds(0)
WindowInner::storage
->WindowInner::storage_ref
,WindowInner::storage
now returns mutable reference
- target module mistakes
If you don't need updates and high performance:
- disable V-Sync,
- set the
auto_redraw
flag tofalse
, - set the maximum of frame rate (30 fps is enough),
- set the 'lazy' mode for
EventLoop
render_context_attributes.vsync=false;
window_attributes.auto_redraw=false;
event_loop_attributes.redraw_request_interval=EventInterval::EventsPerSecond(30);
event_control=EventControl::Lazy;
If you need updates and the lowest response time:
- disable V-Sync,
- set the
auto_redraw
flag tofalse
, - set the needed frame rate,
- set the default mode for
EventLoop
render_context_attributes.vsync=false;
window_attributes.auto_redraw=false;
event_loop_attributes.redraw_request_interval=EventInterval::EventsPerSecond(30);
event_control=EventControl::Run;
If you need updates and the lowest response time:
- enable V-Sync,
- set the
auto_redraw
flag totrue
, - set the frame rate lock to zero,
- set the needed mode for
EventLoop
render_context_attributes.vsync=true;
window_attributes.auto_redraw=true;
event_loop_attributes.redraw_request_interval=EventInterval::EventsPerSecond(0);
event_control=EventControl::Run;
- Raw OpenGL functions
- Raw wrappers
- New object allocation systems: heap- and stack-type
- A new windowing system
- A new app working system
- A basement with secrets and cats
- More unaccomplished features
- More language mistakes :)
- Less comments and docs
Uncreased the stack size up to 1 MiB (1024 * 1024 bytes) due to problems on some versions of Linux.
Now you can draw on everything that implements the Surface
trait.
let texture=Texture::empty([1920u32,1080u32],window.display()).unwrap();
let mut frame_buffer=SimpleFrameBuffer::new(window.display(),&texture.0).unwrap();
let mut frame_buffer_graphics=Graphics{
graphics2d:graphics,
draw_parameters:default_draw_parameters(),
frame:&mut frame_buffer,
};
frame_buffer_graphics.clear_colour(White);
frame_buffer_graphics.draw_textured_object(cat).unwrap();
frame_buffer_graphics.draw_rotate_textured_object(gear,unsafe{window_center},angle).unwrap();
Made the default_draw_parameters
function public.
Fixed setting the index buffer size of the simple graphics.
Added some functions to work with graphic objects and some was renamed.
Now you can directly push ChanneledTrack
to a wrapper.
Added an update per second counter.
Fixed an update rate for closures.
Updated the ttf-parser
crate to 0.9.0
and the ab_glyph_rasterizer
to 0.1.4
.
A lifetime from the DependentObject
trait.
DynamicWindow
and the Window
trait.
WindowBase
from public view.
The Window
field from the WindowPage
trait.
The window draw
function now takes &self
, Graphics2D
and a closure with &mut Graphics
as an argument.
pub fn draw<F:FnOnce(&mut Graphics)>(&self,graphics_base:&Graphics2D,f:F)->Result<(),SwapBuffersError>;
The on_redraw_requested
function of the WindowPage
trait now takes &Window
.
fn on_redraw_requested(&mut self,window:&Window);
Arguments of ImageBase::new
was swapped:
pub fn new([x,y,width,height]:[f32;4],colour_filter:Colour)->ImageBase;
Renamed delete
functions to remove
ones.
Renamed PagedWindow
to Window
.
Separated graphics of windows, but it's still created within them.
Updated the glium
crate to 0.29.0
.
Added DrawDarameters
to Graphics
.
Fixed cat_audio
's features.
Audio is now a separate crate and added as a default feature.
Fixed the bug of multichannel playing.
Added ImageObject
.
Removed DefaultWindow
.
Updated the image
crate to 0.23.12
.
Fixed the bug of starting playing an audio output stream after changing a panicked device on some platforms. Now it saves the last stream's state.
Enabled new audio features: extended_audio
,raw_audio
.
The image
crate to 0.23.11
.
The ttf-parser
crate to 0.8.3
.
TexturedObject
doesn't owe a texture, it should be added seperatly.
Now you are able to control each audio channel yourself.
let audio=Audio::default(AudioSettings::new()).unwrap();
let mut wrapper=AudioWrapper::new(audio);
wrapper.load_track("audio.mp3","test".to_string());
wrapper.play_track("test").unwrap();
// Pausing one channel of the track
wrapper.audio.pause_track(0).unwrap();
It is based on a glyph cache. Load all the needed characters as textures to the cache and then render them.
It's possible to load different fonts in one cache, so you can create your own, but it still have problems with scaling.
As usual you are able to save a glyph cache (in CachedFont
) inside the graphics structure to use text as a dependent object.
Works faster but takes much space.
Now saved objects support only CachedFont
.
Fully-rebuilded, too.
If an audio output device gets unavailable (for example, it has been unplugged), the engine tries to replace it with the new one (choose the default).
Removed the with_host_and_device
, available_hosts
, host_from_id
,
default_output_device
, output_devices
functions.
The play_once
, play_forever
functions are united in the play_track
one.
Reimported the cpal
crate.
The AudioOutputType
enumeration renamed AudioOutputFormat
.
The audio engine converts all sound tracks to the 24-bit format.
Removed NoStream
from the AudioCommandResult
enumeration.
Now you can create an empty texture.
Fixed the text rendering problem.
Updated crates: minimp3
- 0.5.0; image
- 0.23.9.
Now image rendering functions are generalized for all textured objects.
An object system for text graphics and some function for rendering (but there is some artifacts, I will fix them later).
General drawing functions.
User's mouse cursor icon and it's feature.
The alpha_channel
feature and the related functions and fields.
The draw_all_textured_objects
function.
Glyph rendering.
Added output for the DynamicWindow
.
Rendering user's mouse cursor.
Rendering a static textured object.
The range in the MouseCursorIconSettings
.
Text rendering fully has been remade. Now it works faster.
The image
crate has been replaced from crate::texture
to crate
.
The MouseCursor
is now public.
The SimpleObject
trait has been replaced with the DependentObject
,
and textured objects must be implemented for this new trait.
The image
mod has been renamed to texture
.
The image
crate version has been changed to 0.23.8
.
Functions to change saved simple objects directly:
window.graphics().set_simple_object_colour(0,White);
window.graphics().rewrite_simple_object_vertices(0,&[100f32;4])
The draw_raw
function of all the windows.
Removing simple objects now deletes their indices. Removing all the simple objects does not delete the buffer offsets.
The range system for textures has been replaced with an object one.
All the field of the Graphics
are now public.
Window drawing function takes &mut self
instead of &self
.
Feature errors.
The graphics engine is now divided into 2D and 3D (3D is not implemented yet).
A file_drop
feature - enables the next events:
WindowEvent::HoveredFileCancelled
WindowEvent::HoveredFile(PathBuf)
WindowEvent::DroppedFile(PathBuf)
and related functions.
A new event - WindowEvent::ModifiersChanged(ModifiersState)
.
Rotating functions for simple objects.
User's mouse cursor and everything related to it.
Changes in the WindowSettings
fields.
The WindowEvent::Draw
event has been renamed to WindowEvent::RedrawRequested
.
The WindowEvent::Exit
event has been renamed to WindowEvent::CloseRequested
.
The WindowPage::on_close_requested
function has been renamed to WindowPage::on_window_close_requested
.
The range system for simple objects has been replaced with an object one. Now you can add an object to the array and then quickly draw it or the whole array.
Some changes in the SimpleObject
trait.
All the geometric shapes (cat_engine::graphics::*;
) has been moved to cat_engine::shapes::*
.
Update events. You can configure update frequency in the WindowSettings
(GeneralSettings
).
WindowEvent::EventLoopClosed
and WindowEvent::Update
events.
A type Output
field and new functions (on_update_requested
, on_event_loop_closed->Output
) for the WindowPage
trait. The PagedWindow::run_page
function now returns the Output
.
A type defenition PageRef<'a>
for WindowPage
trait objects.
The WindowEvent::Hide(bool)
event. Now only the WindowEvent::Focused(bool)
event is available.
The auto_hide
feature now works fine with the DynamicWindow
.
Replaced the local MouseButton
enum with glutin
one.
The WindowBase
has got a event_loop_proxy
field with EventLoopProxy<InnerWindowEvent>
type
and the event_loop
field type changed to EventLoop<InnerWindowEvent>
.
The initial_colour
field has been moved to the GeneralSettings
.
Now all the windows are compatible.
You can convert one into another, except DynamicWindow
- you can only convert into it.
Now all the errors of user's mouse cursor icon panic with an appropriate message.
New settings for user's mouse cursor icon.
The new window types are DynamicWindow
- a window that uses 'pages' as WindowPage
trait objects,
and WindowBase
- a window base without event handlers.
Window
- a trait for windows. You can create easily your own window with WindowBase
.
All the windows are implemented with it except WindowBase
.
The paged_format
feature.
All the window modifying functions. Now the only way to customize the window is:
let wi=window.display().gl_window();
let w=wi.window();
w.set_minimized(false);
w.set_visible(false);
The window of the default window format is now named DefaultWindow
.
The WindowPage
trait got the type Window
field and a life parameter.
The closure event listeners works correct with the WindowEvent::Resized
event.
For the auto_hide
feature:
when the current 'page' is closed and
the current event listener is for the window minimized state
the next page will be opened with the same listener.
Alpha smoothing functions are now able only with the alpha_smoothing
feature.
Now all drawing functions return the result of drawing.
Added the center of rotation for images.
Added lazy feature (see features).