Skip to content

Instantly share code, notes, and snippets.

View rtroe's full-sized avatar

Rob Tom Roe rtroe

View GitHub Profile
@rtroe
rtroe / VerticesEngineMain.cs
Last active December 17, 2015 08:56
Test Entry
using System;
void main(args[]){
MonoGame.ConvertFromXNA(this);
}
@rtroe
rtroe / Multi-Render Targets.cs
Last active November 30, 2015 01:47
Example of using setting Multiple Render Targets in CSharp
/****************************************************************************/
/* PREP PASS */
/****************************************************************************/
vxEngine.GraphicsDevice.SetRenderTargets(
vxEngine.Renderer.RT_ColourMap,
vxEngine.Renderer.RT_NormalMap,
vxEngine.Renderer.RT_DepthMap);
struct PrepPSOutput
{
half4 Color : COLOR0;
half4 Normal : COLOR1;
half4 Depth : COLOR2;
};
@rtroe
rtroe / HardcodeEuclideanCode.cs
Last active December 2, 2015 01:53
Example of Previous Hardcoded Euclidean Code
//Set Level Bounds
Level_X_Max = 30;
Level_Y_Max = 5;
Level_Z_Max = 15;
//Set Entrance/Exit Positions
Vector_EntrancePos = new Vector3(0, 0, 5);
Vector_ExitPos = new Vector3(Level_X_Max, 7, 5);
base.LoadContent();
void MainFrame::OnCreatewxOCECntrl(wxCommandEvent& WXUNUSED(event))
{
wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
ITEMCOUNT++;
m_ntbk->AddPage(CreatewxOCECntrl(m_ntbk),wxString::Format(wxT("newfile%i.wxoce"), ITEMCOUNT), false, page_bmp);
m_mgr.Update();
}
wxPanel* MainFrame::CreatewxOCECntrl(wxWindow* parent)
//Get wxPanel handle.
GtkWidget* widget = panel->GetHandle();
//Dig through too get x11 handle
Window w = gdk_x11_drawable_get_xid(gtk_widget_get_window(panel->GetHandle()));
//Current line crashes with Bad Window error
//wind = new Xw_Window(aDisplayConnection, w);
//Currently possible too only create seperate Window for Open Cascade
//Get wxPanel Handle (only for wxGTK/Linux)
GtkWidget* widget = panel->GetHandle();
//Required too avoid segfault happens.
gtk_widget_realize( widget );
gtk_widget_set_double_buffered(widget, 0);
//Get Window from wxPanel Handle.
Window wid = GDK_WINDOW_XWINDOW( widget->window );
XSync(GDK_WINDOW_XDISPLAY(widget->window), False);
Handle(V3d_Viewer) wxOCEWindow::Viewer (wxWindow* panel,
const Standard_ExtString theName,
const Standard_CString theDomain,
const Standard_Real theViewSize,
const V3d_TypeOfOrientation theViewProj,
const Standard_Boolean theComputedMode,
const Standard_Boolean theDefaultComputedMode )
{
static Handle(OpenGl_GraphicDriver) aGraphicDriver;
//////////////////////////// VARIABLES /////////////////////////////
//The OCE Window
Handle(Xw_Window) wind;
//The Panel which holds the OCE Window
wxPanel* ctrl ;
//Used for connecting too the Graphics Card
class wxOCEWindow: public wxScrolledWindow
{
public:
wxOCEWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, long style);
...
TCollection_ExtendedString a3DName ("Visu3D");
//Create the Global wxPanel too hold the wxOCE Control