/// <summary> /// Setups up a new DirectX9Canvas instance with the given specifications. /// </summary> /// <param name="driver">DirectX9 driver to associated with this canvas.</param> /// <param name="control">Control to render this canvases graphics to.</param> /// <param name="flags">BitMask of GraphicsFlags flags, specifies how the canvas is setup.</param> public Direct3D9Canvas(Direct3D9Driver driver, Control control, GraphicsFlags flags) { // Store the driver for future use _control = control; _dx9Driver = driver; _flags = flags; // Setup windows components and show it. _control.Resize += new System.EventHandler(ResizeEvent); _control.Disposed += new EventHandler(Disposed); }
/// <summary> /// Creates a new image frame out of a PixelMap and associates it with a specific image. /// </summary> /// <param name="driver">Direct3D9Driver that this image frame should be associated with.</param> /// <param name="pixelMap">PixelMap to create frame from.</param> public Direct3D9Shader(Direct3D9Driver driver, string code) { _dx9Driver = driver; // Create the shader. try { _shader = Effect.FromString(driver.DX9Device, code, null, null, ShaderFlags.None, null); _shader.Technique = "Main"; // Grab the variable handles. SyncVariables(); } catch (Exception) { Runtime.Debug.DebugLogger.WriteLog("An error occured while trying to load shader.", BinaryPhoenix.Fusion.Runtime.Debug.LogAlertLevel.Warning); } // Hook into the dx9 disposal event so we can clean up. _dx9Driver.DX9Device.Disposing += new EventHandler(DX9Device_Disposing); }
public Direct3D9ImageFrame(Direct3D9Driver driver) { _dx9Driver = driver; }
/// <summary> /// Creates a new image frame out of a PixelMap and associates it with a specific image. /// </summary> /// <param name="driver">Direct3D9Driver that this image frame should be associated with.</param> /// <param name="pixelMap">PixelMap to create frame from.</param> public Direct3D9ImageFrame(Direct3D9Driver driver, PixelMap pixelMap) { _dx9Driver = driver; ConstructFromPixelMap(pixelMap); }