C# Class Vocaluxe.Lib.Draw.CDirect3D

Inheritance: System.Windows.Forms.Form, IDraw
Afficher le fichier Open project: stsundermann/Vocaluxe

Méthodes publiques

Méthode Description
AddTexture ( Bitmap bmp ) : Vocaluxe.Lib.Draw.STexture

Adds a texture and stores it in the Vram

AddTexture ( Bitmap bmp, string TexturePath ) : Vocaluxe.Lib.Draw.STexture

Adds a texture and stores it in the Vram

AddTexture ( int W, int H, IntPtr Data ) : Vocaluxe.Lib.Draw.STexture
AddTexture ( int W, int H, byte &Data ) : Vocaluxe.Lib.Draw.STexture
AddTexture ( string TexturePath ) : Vocaluxe.Lib.Draw.STexture

Adds a texture and stores it in the VRam

CDirect3D ( ) : System

Creates a new Instance of the CDirect3D Class

ClearScreen ( ) : void

Removes all textures from the screen

CopyScreen ( ) : Vocaluxe.Lib.Draw.STexture
CopyScreen ( Vocaluxe.Lib.Draw.STexture &Texture ) : void

Copies the current frame into a texture

DrawColor ( Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF rect ) : void

Draws a colored rectangle

DrawLine ( int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2 ) : void

Draws a line

DrawText ( string Text, int x, int y, float h, float z ) : void

Draws a text string

DrawText ( string Text, int x, int y, int h ) : void

Draws a text string

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture ) : void

Draws a texture

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect ) : void

Draws a texture

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color ) : void

Draws a texture

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF bounds ) : void

Draws a texture

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF bounds, bool mirrored ) : void

Draws a texture

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, bool mirrored ) : void

Draws a texture

DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, float begin, float end ) : void

Draws a texture

DrawTextureReflection ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF bounds, float space, float height ) : void

Draws a reflection of a texture

GetScreenHeight ( ) : int

Gets the current viewport height

GetScreenWidth ( ) : int

Gets the current viewport width

GetTextBounds ( Vocaluxe.Menu.CText text ) : RectangleF

Calculates the bounds for a CText object

GetTextBounds ( Vocaluxe.Menu.CText text, float Height ) : RectangleF

Calculates the bounds for a CText object

Init ( ) : bool

Inits the Device

MainLoop ( ) : void

Starts the rendering

MakeScreenShot ( ) : void

Creates a Screenshot of the current frame

QuequeTexture ( int W, int H, byte &Data ) : Vocaluxe.Lib.Draw.STexture
RemoveTexture ( Vocaluxe.Lib.Draw.STexture &Texture ) : void

Removes a texture from the Vram

Reset ( ) : void

Resets the device, all objects in the Direct3D default pool get flushed and need to be recreated

TextureCount ( ) : int

Gets the count of current textures

Unload ( ) : bool

Unloads all Textures and other objects used by Direct3D for rendering

UpdateTexture ( Vocaluxe.Lib.Draw.STexture &Texture, IntPtr Data ) : bool

Updates the data of a texture

UpdateTexture ( Vocaluxe.Lib.Draw.STexture &Texture, byte &Data ) : bool

Updates the data of a texture

Méthodes protégées

Méthode Description
OnLoad ( EventArgs e ) : void
OnResize ( EventArgs e ) : void
WndProc ( Message &m ) : void

Private Methods

Méthode Description
AddToVertexBuffer ( TexturedColoredVertex vertices, Texture tex, System.Matrix rotation ) : void

Adds a quad a list which will be added and rendered to the vertexbuffer when calling RenderToVertexBuffer to reduce vertexbuffer calls each frame to a minimum

CalculateRotationMatrix ( float rot, float rx1, float rx2, float ry1, float ry2 ) : System.Matrix
CheckQueque ( ) : void
EnterFullScreen ( ) : void

Triggers the Fullscreen mode

LeaveFullScreen ( ) : void

Triggers the windowed mode

NextPowerOfTwo ( float n ) : float

Calculates the next power of two

OnClosingEvent ( object sender, CancelEventArgs e ) : void
OnKeyDown ( object sender, System e ) : void
OnKeyPress ( object sender, System e ) : void
OnKeyUp ( object sender, System e ) : void
OnMouseDown ( object sender, MouseEventArgs e ) : void
OnMouseEnter ( object sender, EventArgs e ) : void
OnMouseLeave ( object sender, EventArgs e ) : void
OnMouseMove ( object sender, MouseEventArgs e ) : void
OnMouseUp ( object sender, MouseEventArgs e ) : void
OnMouseWheel ( object sender, MouseEventArgs e ) : void
OnPaintEvent ( object sender, PaintEventArgs e ) : void
OnPreviewKeyDown ( object sender, System e ) : void
OnResizeEvent ( object sender, EventArgs e ) : void
RResize ( ) : void

Resizes the viewport

RenderVertexBuffer ( ) : void

Renders the vertex buffer

_TextureExists ( Vocaluxe.Lib.Draw.STexture &Texture ) : bool

Checks if a texture exists

Method Details

AddTexture() public méthode

Adds a texture and stores it in the Vram
public AddTexture ( Bitmap bmp ) : Vocaluxe.Lib.Draw.STexture
bmp System.Drawing.Bitmap The Bitmap of which the texute will be created from
Résultat Vocaluxe.Lib.Draw.STexture

AddTexture() public méthode

Adds a texture and stores it in the Vram
public AddTexture ( Bitmap bmp, string TexturePath ) : Vocaluxe.Lib.Draw.STexture
bmp System.Drawing.Bitmap The Bitmap of which the texute will be created from
TexturePath string The path to the texture
Résultat Vocaluxe.Lib.Draw.STexture

AddTexture() public méthode

public AddTexture ( int W, int H, IntPtr Data ) : Vocaluxe.Lib.Draw.STexture
W int
H int
Data System.IntPtr
Résultat Vocaluxe.Lib.Draw.STexture

AddTexture() public méthode

public AddTexture ( int W, int H, byte &Data ) : Vocaluxe.Lib.Draw.STexture
W int
H int
Data byte
Résultat Vocaluxe.Lib.Draw.STexture

AddTexture() public méthode

Adds a texture and stores it in the VRam
public AddTexture ( string TexturePath ) : Vocaluxe.Lib.Draw.STexture
TexturePath string The texture's filepath
Résultat Vocaluxe.Lib.Draw.STexture

CDirect3D() public méthode

Creates a new Instance of the CDirect3D Class
public CDirect3D ( ) : System
Résultat System

ClearScreen() public méthode

Removes all textures from the screen
public ClearScreen ( ) : void
Résultat void

CopyScreen() public méthode

public CopyScreen ( ) : Vocaluxe.Lib.Draw.STexture
Résultat Vocaluxe.Lib.Draw.STexture

CopyScreen() public méthode

Copies the current frame into a texture
public CopyScreen ( Vocaluxe.Lib.Draw.STexture &Texture ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture in which the frame is copied to
Résultat void

DrawColor() public méthode

Draws a colored rectangle
public DrawColor ( Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF rect ) : void
color Vocaluxe.Lib.Draw.SColorF The color in which the rectangle will be drawn in
rect Vocaluxe.Lib.Draw.SRectF The coordinates in a SRectF struct
Résultat void

DrawLine() public méthode

Draws a line
public DrawLine ( int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2 ) : void
a int The alpha value from 0-255
r int The red value from 0-255
g int The red value from 0-255
b int The red value from 0-255
w int The width of the line
x1 int The start x-value
y1 int The start y-value
x2 int The end x-value
y2 int The end y-value
Résultat void

DrawText() public méthode

Draws a text string
public DrawText ( string Text, int x, int y, float h, float z ) : void
Text string The text to be drawn
x int The text's x-position
y int The text's y-position
h float The text's height
z float The text's x-position
Résultat void

DrawText() public méthode

Draws a text string
public DrawText ( string Text, int x, int y, int h ) : void
Text string The text to be drawn
x int The text's x-position
y int The text's y-position
h int The text's height
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
color Vocaluxe.Lib.Draw.SColorF A SColorF struct containing a color which the texture will be colored in
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF bounds ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
color Vocaluxe.Lib.Draw.SColorF A SColorF struct containing a color which the texture will be colored in
bounds Vocaluxe.Lib.Draw.SRectF A SRectF struct containing which part of the texture should be drawn
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF bounds, bool mirrored ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
color Vocaluxe.Lib.Draw.SColorF A SColorF struct containing a color which the texture will be colored in
bounds Vocaluxe.Lib.Draw.SRectF A SRectF struct containing which part of the texture should be drawn
mirrored bool True if the texture should be mirrored
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, bool mirrored ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
color Vocaluxe.Lib.Draw.SColorF A SColorF struct containing a color which the texture will be colored in
mirrored bool True if the texture should be mirrored
Résultat void

DrawTexture() public méthode

Draws a texture
public DrawTexture ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, float begin, float end ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
color Vocaluxe.Lib.Draw.SColorF A SColorF struct containing a color which the texture will be colored in
begin float A Value ranging from 0 to 1 containing the beginning of the texture
end float A Value ranging from 0 to 1 containing the ending of the texture
Résultat void

DrawTextureReflection() public méthode

Draws a reflection of a texture
public DrawTextureReflection ( Vocaluxe.Lib.Draw.STexture Texture, Vocaluxe.Lib.Draw.SRectF rect, Vocaluxe.Lib.Draw.SColorF color, Vocaluxe.Lib.Draw.SRectF bounds, float space, float height ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture of which a reflection should be drawn
rect Vocaluxe.Lib.Draw.SRectF A SRectF struct containing the destination coordinates
color Vocaluxe.Lib.Draw.SColorF A SColorF struct containing a color which the texture will be colored in
bounds Vocaluxe.Lib.Draw.SRectF A SRectF struct containing which part of the texture should be drawn
space float The space between the texture and the reflection
height float The height of the reflection
Résultat void

GetScreenHeight() public méthode

Gets the current viewport height
public GetScreenHeight ( ) : int
Résultat int

GetScreenWidth() public méthode

Gets the current viewport width
public GetScreenWidth ( ) : int
Résultat int

GetTextBounds() public méthode

Calculates the bounds for a CText object
public GetTextBounds ( Vocaluxe.Menu.CText text ) : RectangleF
text Vocaluxe.Menu.CText The CText object of which the bounds should be calculated for
Résultat System.Drawing.RectangleF

GetTextBounds() public méthode

Calculates the bounds for a CText object
public GetTextBounds ( Vocaluxe.Menu.CText text, float Height ) : RectangleF
text Vocaluxe.Menu.CText The CText object of which the bounds should be calculated for
Height float The height of the CText object
Résultat System.Drawing.RectangleF

Init() public méthode

Inits the Device
public Init ( ) : bool
Résultat bool

MainLoop() public méthode

Starts the rendering
public MainLoop ( ) : void
Résultat void

MakeScreenShot() public méthode

Creates a Screenshot of the current frame
public MakeScreenShot ( ) : void
Résultat void

OnLoad() protected méthode

protected OnLoad ( EventArgs e ) : void
e System.EventArgs
Résultat void

OnResize() protected méthode

protected OnResize ( EventArgs e ) : void
e System.EventArgs
Résultat void

QuequeTexture() public méthode

public QuequeTexture ( int W, int H, byte &Data ) : Vocaluxe.Lib.Draw.STexture
W int
H int
Data byte
Résultat Vocaluxe.Lib.Draw.STexture

RemoveTexture() public méthode

Removes a texture from the Vram
public RemoveTexture ( Vocaluxe.Lib.Draw.STexture &Texture ) : void
Texture Vocaluxe.Lib.Draw.STexture The texture to be removed
Résultat void

Reset() public méthode

Resets the device, all objects in the Direct3D default pool get flushed and need to be recreated
public Reset ( ) : void
Résultat void

TextureCount() public méthode

Gets the count of current textures
public TextureCount ( ) : int
Résultat int

Unload() public méthode

Unloads all Textures and other objects used by Direct3D for rendering
public Unload ( ) : bool
Résultat bool

UpdateTexture() public méthode

Updates the data of a texture
public UpdateTexture ( Vocaluxe.Lib.Draw.STexture &Texture, IntPtr Data ) : bool
Texture Vocaluxe.Lib.Draw.STexture The texture to update
Data System.IntPtr A Pointer containing the data of which the texture should be updated
Résultat bool

UpdateTexture() public méthode

Updates the data of a texture
public UpdateTexture ( Vocaluxe.Lib.Draw.STexture &Texture, byte &Data ) : bool
Texture Vocaluxe.Lib.Draw.STexture The texture to update
Data byte A byte array containing the new texture's data
Résultat bool

WndProc() protected méthode

protected WndProc ( Message &m ) : void
m System.Windows.Forms.Message
Résultat void