lexsdl 0.3.0

A wrapper for SDL2 to abstract away annoying parts
<!DOCTYPE html>
<html>
<head>
	<title>Rendering</title>
	<link rel="stylesheet" href="styles.css">
</head>
<header>
	<h1>Rendering<h1>
	<hr>
</header>
<body>
	<p>
		A main part of SDL is rendering.<br>
		LEXSDL abstracts many things away like loading textures and handles them, the SDL_Renderer is stored internally so there is no need to carry it around.<br>
		Drawing a loaded texture is as easy to call LEXSDL_DrawTextureAt(2, 50,120, 75,75);<br>
		Below are listed the functions and how to use them.<br>
	</p>
	<hr>
	<h2 id=renderer>Renderer</h2>
		The SDL_Renderer is stored internally so that there is no need to handle it directly but since not all SDL functions are wrapped it can be accesed directly by the <a href=LEXSDL_GetRenderer.html>LEXSDL_GetRenderer<span style="color:#66cf8d">()</span></a> function to get a direct pointer to the renderer being used.
	<h3>Functions</h3>
	<ul>
		<b>&gt; Creation</b><br>
		<a href=LEXSDL_CreateRenderer.html>LEXSDL_CreateRenderer</a><br>
		<br>
		<b>&gt; Getters and Setters</b><br>
		<a href=LEXSDL_GetBackgroundColor.html>LEXSDL_GetBackgroundColor</a><br>
		<a href=LEXSDL_GetDrawColor.html>LEXSDL_GetDrawColor</a><br>
		<a href=LEXSDL_GetRenderer.html>LEXSDL_GetRenderer</a><br>
		<a href=LEXSDL_SetRenderer.html>LEXSDL_SetRenderer</a><br>
		<br>
		<b>&gt; Manipulation</b><br>
		<a href=LEXSDL_SetBackgroundColor.html>LEXSDL_SetBackgroundColor</a><br>
		<a href=LEXSDL_SetDrawColor.html>LEXSDL_SetDrawColor</a><br>
		<br>
		<b>&gt; Rendering</b><br>
		<a href=LEXSDL_NewFrame.html>LEXSDL_NewFrame</a><br>
		<a href=LEXSDL_ShowFrame.html>LEXSDL_ShowFrame</a><br>
	</ul>
	<hr>
	<h2 id=textures>Textures</h2>
		Loading and rendering of textures made easier.<br>
		<span class=warning>WARNING</span> <b>:</b> Its not checked if the texture is valid at drawing which could cause <span style=color:#ff2525>segfaults</span> and or <span style=color:#aaaa00>undefined behavior</span>.<br>

	<h3>Types</h3>
	<ul>
		<a href=LEXSDL_TextureID.html class=type>LEXSDL_TextureID</a><br>
	</ul>
	<h3>Constants</h3>
	<ul>
		<a href=LEXSDL_TextureIDInvalid.html class=preprocessor>LEXSDL_TextureIDInvalid</a><br>
		<a href=LEXSDL_TextureInvalid.html class=preprocessor>LEXSDL_TextureInvalid</a><br>
		<a href=LEXSDL_TextureCreationFailed.html class=preprocessor>LEXSDL_TextureCreationFailed</a><br>
		<a href=LEXSDL_TextureAddingFailed.html class=preprocessor>LEXSDL_TextureAddingFailed</a><br>
		<a href=LEXSDL_TextureOperationSucceded.html class=preprocessor>LEXSDL_TextureOperationSucceded</a><br>
	</ul>
	<h3>Functions</h3>
	<ul>
		<b>&gt; Creation/Loading</b><br>
		<a href=LEXSDL_TextureAdd.html>LEXSDL_TextureAdd</a><br>
		<a href=LEXSDL_TextureLoad.html>LEXSDL_TextureLoad</a><br>
		<a href=LEXSDL_TextureLoadBytes.html>LEXSDL_TextureLoadBytes</a><br>
		<br>
		<b>&gt; Getters</b><br>
		<a href=LEXSDL_TextureGet.html>LEXSDL_TextureGet</a><br>
		<br>
		<b>&gt; Manipulation</b><br>
		<a href=LEXSDL_TextureChangeAlpha.html>LEXSDL_TextureChangeAlpha</a><br>
		<a href=LEXSDL_TextureChangeColor.html>LEXSDL_TextureChangeColor</a><br>
		<a href=LEXSDL_TextureDestroy.html>LEXSDL_TextureDestroy</a><br>
		<br>
		<b>&gt; Drawing</b><br>
		<a href=LEXSDL_TextureDraw.html>LEXSDL_TextureDraw</a><br>
		<a href=LEXSDL_TextureDrawAt.html>LEXSDL_TextureDrawAt</a><br>
		<a href=LEXSDL_TextureDrawFill.html>LEXSDL_TextureDrawFill</a><br>
		<a href=LEXSDL_TextureDrawRot.html>LEXSDL_TextureDrawRot</a><br>
		<a href=LEXSDL_TextureDrawRotAt.html>LEXSDL_TextureDrawRotAt</a><br>
		<a href=LEXSDL_TextureDrawRotCenterAt.html>LEXSDL_TextureDrawRotCenterAt</a><br>
	</ul>
	<hr>
	<h2 id=sprites>Sprites</h2>
	<p>
		Doesn't store a texture, a <a href=#textures>texture</a> needs to be loaded separately and set the id at creation or after the fact.<br>
		Sprites have 2 playing modes, Steeped and Timed.<br>
		<br>
		<b>- Timed :</b><br>
		Plays at the set fps:
		if the sprite fps is set to 15 and display is rendering at 75fps it will show a different frame every 5fps or 13.333.. milliseconds.<br>
		Will skip frames that should occur during a lag spike.<br>
		 a sprite set to 20 fps will update and change the frame 20 times a second, hence FPS (Frames Per Second).<br>
		 <br>
		 <b>- Steeped :</b><br>
		 Advances one frame every time LEXSDL_SpritePlay() is called.<br>
		 <br>
		 Check <a href=LEXSDL_CreateSprite.html>LEXSDL_CreateSprite()</a>.<br>
		 <br>
		<span style=color:#ee0000>WARNING</span> <b>:</b> Its not checked if the texture is valid at drawing/playing which could cause <span style=color:#ff2525>segfaults</span>  and or <span style=color:#aaaa00>undefined behavior</span>.<br>
		The frame shown can be manipulated with <a href=LEXSDL_SpriteSetFrame.html>LEXSDL_SpriteSetFrame()</a> to start from a desired frame.<br>
		For having the same sprite being drawn multiple times check <a href=LEXSDL_SpriteClone>LEXSDL_SpriteClone()</a>;<br>
		The sprite is updated only if a Play function is called or by calling LEXSDL_SpriteUpdate() or LEXSDL_SpriteStep() manually.<br>
		The <a href=CategoryInternal.html#lexsdl_sprite>LEXSDL_Sprite</a> struct is not accesible directly since it could cause hard to find bugs.
	</p>
	<h3>Functions</h3>
	<ul>
		<b>&gt; Creation</b><br>
		<a href=LEXSDL_CreateSprite.html>LEXSDL_CreateSprite</a><br>
		<br>
		<b>&gt; Getters and Setters</b><br>
		<a href=LEXSDL_SpriteGetCurrentFrame.html>LEXSDL_SpriteGetCurrentFrame</a><br>
		<a href=LEXSDL_SpriteGetFrameDimensions.html>LEXSDL_SpriteGetFrameDimensions</a><br>
		<a href=LEXSDL_SpriteGetFrames.html>LEXSDL_SpriteGetFrames</a><br>
		<a href=LEXSDL_SpriteGetFps.html>LEXSDL_SpriteGetFps</a><br>
		<a href=LEXSDL_SpriteGetTexture.html>LEXSDL_SpriteGetTexture</a><br>
		<a href=LEXSDL_SpriteGetTextureId.html>LEXSDL_SpriteGetTextureId</a><br>
		<a href=LEXSDL_SpriteSetTextureId.html>LEXSDL_SpriteSetTextureId</a><br>
		<br>
		<b>&gt; Manipulation</b><br>
		<a href=LEXSDL_SpriteClone.html>LEXSDL_SpriteClone</a><br>
		<a href=LEXSDL_SpriteSkipFrames.html>LEXSDL_SpriteSkipFrames</a><br>
		<a href=LEXSDL_SpriteSetFrame.html>LEXSDL_SpriteSetFrame</a><br>
		<a href=LEXSDL_SpriteUpdate.html>LEXSDL_SpriteUpdate</a><br>
		<br>
		<b>&gt; Drawing/Playing</b><br>
		<a href=LEXSDL_SpritePlay.html>LEXSDL_SpritePlay</a><br>
		<a href=LEXSDL_SpritePlayBackground.html>LEXSDL_SpritePlayBackground</a><br>
		<a href=LEXSDL_SpritePlayFlip.html>LEXSDL_SpritePlayFlip</a><br>
		<a href=LEXSDL_SpritePlayFlipRot.html>LEXSDL_SpritePlayFlipRot</a><br>
		<a href=LEXSDL_SpritePlayRot.html>LEXSDL_SpritePlayRot</a><br>
	</ul>
</body>
<footer>
	<br>
	<hr>
	<a href=FrontPage.html>FrontPage</a> <b>|</b> <a href=https://gitlab.com/Alexevier/lexsdl>GitLab</a> <b>|</b> <a href=https://crates.io/crates/lexsdl>Crates.io</a>
</footer>
</html>