This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Bitmaps to texture. | |
/// </summary> | |
/// <param name="bmp">The BMP.</param> | |
/// <param name="texture">The texture.</param> | |
public unsafe static void BitmapToTexture(Bitmap bitmap, Texture texture) | |
{ | |
var bmp = bitmap.Clone(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), System.Drawing.Imaging.PixelFormat.Format32bppArgb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void CreateScene() | |
{ | |
_entity = _root.SceneManager.CreateEntity("CubeBrowser", PrefabEntity.Cube); | |
_sceneNode = Root.Instance.SceneManager.RootSceneNode.CreateChildSceneNode(); | |
_sceneNode.AttachObject(_entity); | |
_sceneNode.Yaw(45); | |
_sceneNode.Position = new Vector3(0, 0, -300); | |
Bitmap bmp = new Bitmap(100, 100, System.Drawing.Imaging.PixelFormat.Format32bppArgb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Axiom.Graphics; | |
using Axiom.Core; | |
using Axiom.Media; | |
using System.Drawing.Imaging; | |
using System.IO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void BrowserManager_BrowserRenderEvent(Guid id, System.Drawing.Bitmap screen) | |
{ | |
if (id == _browserId) | |
{ | |
_texture = TextureManager.Instance.CreateManual("DynamicTexture", ResourceGroupManager.DefaultResourceGroupName, TextureType.TwoD, screen.Width, screen.Height, 0, Axiom.Media.PixelFormat.R8G8B8A8, TextureUsage.RenderTarget); | |
_material = (Material)MaterialManager.Instance.Create("DynamicMaterial", ResourceGroupManager.DefaultResourceGroupName); | |
_material.GetTechnique(0).GetPass(0).CreateTextureUnitState("DynamicTexture"); | |
var bitmapData = screen.LockBits( | |
new System.Drawing.Rectangle(0, 0, screen.Width, screen.Height), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var buffer = _texture.GetBuffer(); | |
buffer.Lock(Axiom.Graphics.BufferLocking.Normal); | |
DirectX does not allow locking of or directly writing to RenderTargets. | |
Use BlitFromMemory if you need the contents. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<normutils.data.Entities.DHCPLease> _leases; | |
using (ISession session = Global._DatabaseConn.OpenSession()) | |
{ | |
using (ITransaction transaction = session.BeginTransaction()) | |
{ | |
// Get list of all Leases | |
//Leases = session.CreateCriteria(typeof(normutils.data.Entities.DHCPLease)).List<normutils.data.Entities.DHCPLease>(); | |
var LQ = session.Query<normutils.data.Entities.DHCPLease>(); | |
_leases = (from v in LQ | |
where v.BindState == "active" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Serverside -- | |
nowjs.on('connect', function() { | |
util.log('Sending Message?'); | |
this.now.receiveMessage('SERVER', 'Welcome to NowJS.'); | |
}); | |
everyone.now.distributeMessage = function(message) { | |
everyone.now.receiveMessage(this.now.name, message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override int Read(byte[] buffer, int offset, int count) | |
{ | |
lock (_incomingLock) | |
{ | |
_incomingMemoryStream.Position = 0; | |
var cnt = _incomingMemoryStream.Read(buffer, offset, count); | |
int amountleft = (int)(_incomingMemoryStream.Length - _incomingMemoryStream.Position); | |
var newMs = new MemoryStream(); | |
if (amountleft > 0) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{SERVER_PORT} !^80$ | |
RewriteRule ^(.*) http://%{SERVER_NAME}%{REQUEST_URI} [L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------- | |
// - Branches Table Mapping - Branches.cs | |
// ------------------------------------- | |
// Initial Table Mapping - 01.02.2011 - B Allen | |
using System; | |
using System.Collections.Generic; | |
using System.Data.Linq; | |
using System.Text; | |
using normist.data.Abstraction; | |
using NHibernate.Mapping.Attributes; |