void IPaintTo3D.SelectedList(IPaintTo3DList paintThisList, int wobbleRadius) { DisplayList dl = paintThisList as DisplayList; graphics.DrawImageUnscaled(dl.bitmap, 0, 0); // dl.bitmap.Save("tmp.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); }
private void CreateDisplayList(OpenGL gl) { displayList = new DisplayList(); displayList.Generate(gl); displayList.New(gl, DisplayList.DisplayListMode.CompileAndExecute); //Push all attributes, disable lighting and depth testing. gl.PushAttrib(OpenGL.GL_CURRENT_BIT | OpenGL.GL_ENABLE_BIT | OpenGL.GL_LINE_BIT | OpenGL.GL_DEPTH_BUFFER_BIT); gl.Disable(OpenGL.GL_LIGHTING); gl.Disable(OpenGL.GL_TEXTURE_2D); gl.DepthFunc(OpenGL.GL_ALWAYS); //Set line width. gl.LineWidth(lineWidth); //Draw the line. gl.Begin(OpenGL.GL_LINES); gl.Color(Convert.ColorToGLColor(c1)); gl.Vertex(v1.X, v1.Y, v1.Z); gl.Color(Convert.ColorToGLColor(c2)); gl.Vertex(v2.X, v2.Y, v2.Z); gl.End(); // Restore attributes. gl.PopAttrib(); displayList.End(gl); }
/// <summary> /// Inicijalizacija i podesavanje OpenGL parametara. /// </summary> public void Initialize() { LoadTextures(); lista = new DisplayList(); lista.Generate(gl); lista.New(gl, DisplayList.DisplayListMode.Compile); gl.PushAttrib(OpenGL.GL_ENABLE_BIT); gl.PushAttrib(OpenGL.GL_TEXTURE_BIT); gl.PushAttrib(OpenGL.GL_POLYGON_BIT); gl.PushAttrib(OpenGL.GL_CURRENT_BIT); gl.Enable(OpenGL.GL_TEXTURE_2D); gl.Enable(OpenGL.GL_CULL_FACE); gl.FrontFace(OpenGL.GL_CCW); RenderNode(m_scene.RootNode); gl.PopAttrib(); gl.PopAttrib(); gl.PopAttrib(); gl.PopAttrib(); lista.End(gl); }
public void AddDisplayList(DisplayList dl, int layer) { Renderer.DisplayListEntry entry = new Renderer.DisplayListEntry(); entry.dl = dl; entry.layer = layer; dls.Add(entry); }
public MainGame() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.GameInfo = new GameInfo(); this.DownInfo = new DownInfo(); this.Teams = new Team[NUM_SIDES]; this.Sides = new Side[NUM_SIDES]; this.CurrentPlay = new Play[NUM_SIDES]; this.Playbook = new Playbook[NUM_SIDES]; this.ObjectDispList = new DisplayList(); this.ShadowDispList = new DisplayList(); this.VPads = new VPad[NUM_SIDES]; this.MsgMgr = new MessageManager(); this.BeginGameStage = new BeginGameStage(this); this.CheckTimeStage = new CheckTimeStage(this); this.CoinTossStage = new CoinTossStage(this); this.EndGameStage = new EndGameStage(this); this.FirstDownStage = new FirstDownStage(this); this.HalfTimeStage = new HalfTimeStage(this); this.PlayStage = new PlayStage(this); this.SelectGameModeStage = new SelectGameModeStage(this); this.SelectInputStage = new SelectInputStage(this); this.SelectPlayStage = new SelectPlayStage(this); this.SelectTeamStage = new SelectTeamStage(this); this.TitleScreenStage = new TitleScreenStage(this); this.TouchdownStage = new TouchdownStage(this); this.TurnOverStage = new TurnOverStage(this); }
/// <summary>Parse a Displaylist to an Object3D.</summary> /// <param name="obj">The Object3D where the model should be parsed to.</param> /// <param name="dl">The Displaylist which should be parsed.</param> /// <param name="rommgr">The RomManager Instance to use.</param> /// <param name="AreaID">The Area ID if avaiable.</param> public static Task ConvertAsync(Object3D obj, DisplayList dl, RomManager rommgr, byte?AreaID) { var t = new Task(() => Convert(obj, dl, rommgr, AreaID)); t.Start(); return(t); }
private void GLElement_GLInitialized(object sender, EventArgs e) { InitializeShaders(); // Initialize textures CirclesTexture = new Texture2D(MakeImageCircles(512), false); var bitmap = Draw.Bitmap.FromFile(@"Toco Toucan.jpg", true) as System.Drawing.Bitmap; FileTexture = new Texture2D(bitmap, false); Texture2D.Disable2DTextures(); // Initialize SFM boxList = new DisplayList(); boxList.Initialize(() => new Box(100000).Draw()); cylinderList = new DisplayList(); cylinderList.Initialize(() => new Cylinder(100000).Draw()); sphereList = new DisplayList(); sphereList.Initialize(() => new Sphere(100000).Draw()); //InitializeView(); int size = (int)Math.Min(GLElement1.ActualWidth, GLElement1.ActualHeight); FBO = new FrameBuffer(); FBO.Initialize(size, size); }
public void DisplayListTest() { var displayList = new DisplayList(new List <IScreen>()); Assert.IsNotNull(displayList.All); Assert.IsNotNull(displayList.LeftMost); Assert.IsNotNull(displayList.TopMost); Assert.IsNotNull(displayList.BottomMost); Assert.IsNotNull(displayList.RightMost); Assert.IsNotNull(displayList.GetScreenInformation()); Assert.AreEqual(0, displayList.All.Count); var gotException = false; try { displayList = new DisplayList(null); } catch (ArgumentNullException) { gotException = true; } Assert.IsTrue(gotException, "Should have thrown"); }
public void Retrieve(String sortType, String gIdFilter, String nickFilter) { LinkedList <Message> tmpList = null; //trying to load new messages from the server. 2 methods from messages handler. 1- if no filter, 2- with filter try { if (gIdFilter.Equals(String.Empty)) { tmpList = new LinkedList <Message>(messageHandler.loadMessages(sortType, descending, this._DisplayList)); } else { tmpList = new LinkedList <Message>(messageHandler.loadMessages(sortType, descending, this._DisplayList, gIdFilter, nickFilter)); } } catch { if (log != null) { log.Error("The client has lost it's connection to the server"); } throw new Exception("Connection to the the server has been lost"); } int overloadCount = tmpList.Count(); //checking if our list is full and if so, removing the first messages. if (DisplayList.Count == MessageHandler.MAX_LIST_SIZE) { while (overloadCount > 0) { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { this.DisplayList.RemoveAt(DisplayList.IndexOf(DisplayList.OrderBy(m => m.Date).FirstOrDefault <Message>())); })); overloadCount--; } } Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { if (descending) //adding messages by descending { foreach (Message msg in tmpList.ToList <Message>()) { this.DisplayList.Add(msg); } } else { foreach (Message msg in tmpList.ToList <Message>()) //adding messages by ascending { DisplayList.Insert(0, msg); } } if (tmpList.Count > 0) { sortTypeChanged(sortType); //we want the list keep updating and not losing it's sorting. } })); }
/// <summary> /// Creates all text fields for an MFD panel (28 items) /// Copies the display attributes from the prototype TextItem /// </summary> /// <param name="labels">The list of labels to print (takes from the beginning as long as it lasts if not 28 provided)</param> /// <returns>A TextItem("LABELS") containing all labels as SubItemList</returns> public static TextItem LabelList(TextItem prototype, Dictionary <string, string> labels) { var list = new DisplayList( ); // create an item that just carries the sublist of text items var ret = new TextItem( ) { Key = c_LabelKey, String = "", // no show item }; TextItem item = null; // sub item to add //setup the label rectangles for (int i = 0; i < labels.Count; i++) { item = prototype.Clone( ); item.Key = labels.ElementAt(i).Key; item.String = labels.ElementAt(i).Value; item.Rectangle = MfdLabelRect[i]; item.StringFormat.Alignment = MfdLabelStringAlignment[i]; list.AddItem(item); } // finally add the stuff and return ret.SubItemList.AddRange(list); return(ret); }
public void Render(object sender) { if (ListName != null) { DisplayList.Call(ListName); } }
//gm: from the OpenTK source code (Graphics\GraphicsMode.cs), here is GraphicsMode.Default, it does seem to select sensible choices -> default display bpp, 16 bit depth buffer, 0 bit stencil buffer, 2 buffers public Game() : base(Constants.DEFAULT_GAME_WIDTH, Constants.DEFAULT_GAME_HEIGHT, GraphicsMode.Default, string.Format("Voxel Game {0}: {1}", Settings.VersionDisplay, Config.UserName)) { //note: cant easily thread these loading tasks because they all need to run on the thread that creates the GL context Settings.Game = this; Diagnostics.LoadDiagnosticProperties(); var stopwatch = new Stopwatch(); stopwatch.Start(); Sounds.Audio.LoadSounds(); //ensure sounds are loaded before they are needed Debug.WriteLine("Sounds load time: {0}ms", stopwatch.ElapsedMilliseconds); stopwatch.Restart(); Textures.TextureLoader.Load(); //ensure textures are loaded before they are needed Debug.WriteLine("Textures load time: {0}ms", stopwatch.ElapsedMilliseconds); stopwatch.Restart(); DisplayList.LoadDisplayLists(); //ensure display lists are loaded before they are needed Debug.WriteLine("Display Lists load time: {0}ms", stopwatch.ElapsedMilliseconds); VSync = Config.VSync ? VSyncMode.On : VSyncMode.Off; if (Config.IsSinglePlayer) { var playerCoords = new Coords(WorldData.SizeInBlocksX / 2f, 0, WorldData.SizeInBlocksZ / 2f); //start player in center of world playerCoords.Yf = WorldData.Chunks[playerCoords].HeightMap[playerCoords.Xblock % Chunk.CHUNK_SIZE, playerCoords.Zblock % Chunk.CHUNK_SIZE] + 1; //start player on block above the surface Player = new Player(0, Config.UserName, playerCoords); NetworkClient.Players.TryAdd(Player.Id, Player); //note: it is not possible for the add to fail on ConcurrentDictionary, see: http://www.albahari.com/threading/part5.aspx#_Concurrent_Collections } }
public void Clear() { _dictionary.Clear(); _index.Clear(); _reverseIndex.Clear(); DisplayList.Clear(); }
/// <summary> /// Creates the display list. This function draws the /// geometry as well as compiling it. /// </summary> private void CreateDisplayList(OpenGL gl) { // Create the display list. displayList = new DisplayList(); // Generate the display list and displayList.Generate(gl); displayList.New(gl, DisplayList.DisplayListMode.CompileAndExecute); // Push attributes, set the color. gl.PushAttrib(OpenGL.GL_CURRENT_BIT | OpenGL.GL_ENABLE_BIT | OpenGL.GL_LINE_BIT); gl.Disable(OpenGL.GL_LIGHTING); gl.Disable(OpenGL.GL_TEXTURE_2D); gl.LineWidth(1.0f); // Draw the grid lines. gl.Begin(OpenGL.GL_LINES); for (int i = -10; i <= 10; i++) { float fcol = ((i % 10) == 0) ? 0.3f : 0.15f; gl.Color(fcol, fcol, fcol); gl.Vertex(i, -10, 0); gl.Vertex(i, 10, 0); gl.Vertex(-10, i, 0); gl.Vertex(10, i, 0); } gl.End(); // Restore attributes. gl.PopAttrib(); // End the display list. displayList.End(gl); }
private async void ButtonClickCommandReceiver() { try { bool result = true; if (DisplayList == null) { DisplayList = new ObservableCollection <Country>(); } UserDialogs.Instance.ShowLoading("Loading..."); await Task.Delay(1500); // Service Hit. result = await Application.Current.MainPage.DisplayAlert("Alert", "Add Item ?", "Yes", "No"); DisplayList.Add(new Country { Name = "NEW COUNTRY : " + DisplayList.Count.ToString() }); UserDialogs.Instance.HideLoading(); } catch (System.Exception ex) { Debug.WriteLine(ex.Message); } }
public DisplayList BuildDisplayList(IReadOnlyFRPC dataPaths) { DisplayList dl = new DisplayList(); FillLeafDisplayList(dl, dataPaths); return(dl); }
private void FillLeafDisplayList(DisplayList dl, IReadOnlyFRPC dataPaths) { bool isLeafNode = IsLeaf; if (isLeafNode) { int pathIdx = dataPaths.TryGetIndexFromPath(LeafPath); if (pathIdx != -1) { dl.Cmds.Add(new DisplayListCmd(dl.Items.Count, 1, this)); dl.Items.Add(new ListItem(false, pathIdx, DisplayScale)); } } else if (IsCollapsed) { int firstItem = dl.Items.Count; FillListItems(dl.Items, dataPaths); int numItems = dl.Items.Count - firstItem; if (numItems > 0) { dl.Cmds.Add(new DisplayListCmd(firstItem, numItems, this)); } } else { foreach (ProfilerRDI childRdi in Children) { if (childRdi.Displayed) { childRdi.FillLeafDisplayList(dl, dataPaths); } } } }
public void search(object param) { try { DisplayList.Clear(); if (!string.IsNullOrWhiteSpace(param.ToString())) { foreach (var u in Qsearchlist.Where(x => x.SearchString.ToUpper().Contains(param.ToString().ToUpper()))) { DisplayList.Add(u); } } else { foreach (var u in Qsearchlist) { DisplayList.Add(u); } } } catch (Exception E) { ExepionLogger.Logger.LogException(E); ExepionLogger.Logger.Show(E); } }
/// <summary> /// Freezes the specified instance. /// </summary> /// <param name="gl">The gl instance.</param> /// <param name="renderable">The renderable.</param> public void Freeze(OpenGL gl, IRenderable renderable) { // Handle the trivial case. if (isFrozen) { return; } // Create the display list. if (displayList != null) { displayList.Delete(gl); } displayList = new DisplayList(); displayList.Generate(gl); // Start the display list. displayList.New(gl, DisplayList.DisplayListMode.Compile); // Render the object. renderable.Render(gl, RenderMode.Design); // End the display list. displayList.End(gl); // We are now frozen. isFrozen = true; }
/// <summary> /// Inicijalizacija i podesavanje OpenGL parametara. /// </summary> public void Initialize() { lista = new DisplayList(); lista.Generate(gl); lista.New(gl, DisplayList.DisplayListMode.Compile); RenderNode(m_scene.RootNode); lista.End(gl); }
public ActionResult Index() { DBfirstdemoEntities2 context = new DBfirstdemoEntities2(); DisplayList model = new DisplayList(); model.desList = context.Designations.ToList(); model.empList = context.People.ToList(); return(View(model)); }
public MainWindow() { InitializeComponent(); MinimizeToTray.Enable(this); var i = GetIndexCount(); for (int j = 0; j < i; j++) { DisplayList.Add(new DisplayItem() { Name = "Display " + j, Id = UInt32.Parse("" + j) }); } var items = new ArrayList() { new DisplayItem() { Name = "100%", Id = 100 }, new DisplayItem() { Name = "125%", Id = 125 }, new DisplayItem() { Name = "150%", Id = 150 }, new DisplayItem() { Name = "175%", Id = 175 }, new DisplayItem() { Name = "200%", Id = 200 }, new DisplayItem() { Name = "225%", Id = 225 } }; foreach (var item in items) { DesktopDPIList.Add(item); TabletDPIList.Add(item); } currentMode = Mode; dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += new EventHandler(Background); dispatcherTimer.Interval = new TimeSpan(0, 0, 2); dispatcherTimer.Start(); //var watcher = System.Devices.DeviceInformation.createWatcher(); // need uwp for that - in uwp the dll doesn't work.. }
public void reverse() { descending = !descending; Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { this.DisplayList = new ObservableCollection <Message>(DisplayList.Reverse <Message>()); })); }
IPaintTo3DList IPaintTo3D.CloseList() { displayList.Close(); graphics = oldGraphics; IPaintTo3DList res = displayList; displayList = null; return(res); }
private void ItemTappedCommandReceiver(Country model) { if (SelectedCountry != null) { CountryName = SelectedCountry.Name; int index = DisplayList.IndexOf(SelectedCountry); DisplayList.Move(index, 0); } }
internal override void Render(FrameEventArgs e) { base.Render(e); GL.PushMatrix(); GL.Translate(Coords.Xf, Coords.Yf, Coords.Zf); GL.Rotate(WorldHost.RotationCounter, -Vector3.UnitY); DisplayList.RenderDisplayList(DisplayList.BlockQuarterId, Block.FaceTexture(BlockType, Face.Top)); GL.PopMatrix(); }
public void updatelist(List <IDataModel> searchlist) { DisplayList.Clear(); foreach (dynamic Item in searchlist) { DisplayList.Add(Item); } Qsearchlist = new List <IDataModel>(DisplayList); }
public void GetScreenInformationTest() { var displays = new DisplayList( new [] { new VirtualScreen(32, new Rectangle(100, 200, 300, 400), "virtualScreen", true, new Rectangle(105, 205, 200, 200)), } ); var screenInfo = displays.GetScreenInformation(); Assert.IsNotNull(screenInfo); Console.WriteLine(screenInfo); }
// event is fired when user pulls down on list to refresh private void List_Refreshing(object sender, EventArgs e) { // clear the display list and reset both indexes DisplayList.Clear(); Display_Index = 0; Model_Index = 0; // must set isRefreshing to false after event fires ((ListView)sender).IsRefreshing = false; DisplayAlert("Feeling Refreshed!", "Let's do it again!", "OK"); }
public static bool IsList(OpenGL gl, DisplayList displayList) { // Is the specified list a proper display list? if (gl.IsList(displayList.list) == OpenGL.GL_TRUE) { return(true); } else { return(false); } }
/// <summary> /// Creates the display list. This function draws the /// geometry as well as compiling it. /// </summary> private void CreateDisplayList(OpenGL gl) { // Create the display list. displayList = new DisplayList(); // Generate the display list and displayList.Generate(gl); displayList.New(gl, DisplayList.DisplayListMode.CompileAndExecute); // Push all attributes, disable lighting and depth testing. gl.PushAttrib(OpenGL.GL_CURRENT_BIT | OpenGL.GL_ENABLE_BIT | OpenGL.GL_LINE_BIT | OpenGL.GL_DEPTH_BUFFER_BIT); gl.Disable(OpenGL.GL_LIGHTING); gl.Disable(OpenGL.GL_TEXTURE_2D); gl.DepthFunc(OpenGL.GL_ALWAYS); // Set a nice fat line width. gl.LineWidth(1.50f); // Draw the axies. gl.Begin(OpenGL.GL_LINES); gl.Color(1f, 0f, 0f, 1f); gl.Vertex(0, 0, 0); gl.Vertex(3, 0, 0); gl.Color(0f, 1f, 0f, 1f); gl.Vertex(0, 0, 0); gl.Vertex(0, 3, 0); gl.Color(0f, 0f, 1f, 1f); gl.Vertex(0, 0, 0); gl.Vertex(0, 0, 3); gl.End(); // Restore attributes. gl.PopAttrib(); // End the display list. displayList.End(gl); }
/// <summary> /// Freezes the specified instance. /// </summary> /// <param name="gl">The gl instance.</param> /// <param name="renderable">The renderable.</param> public void Freeze(OpenGL gl, IRenderable renderable) { // Handle the trivial case. if (isFrozen) return; // Create the display list. if (displayList != null) displayList.Delete(gl); displayList = new DisplayList(); displayList.Generate(gl); // Start the display list. displayList.New(gl, DisplayList.DisplayListMode.Compile); // Render the object. renderable.Render(gl, RenderMode.Design); // End the display list. displayList.End(gl); // We are now frozen. isFrozen = true; }
internal GridPopulatedLeafNode(GridUnpopulatedLeafNode unpopulated) { this.Parent = unpopulated.Parent; this.Rectangle = unpopulated.Rectangle; this.BoundingRectangle = GridBounds.Uninitialized; this.VisibleLeafNodes = null; this.StaticOpaqueObjects = new StaticOpaqueObject[] { null }; this.StaticOpaqueObjectCount = 0; this.DisplayList = new DisplayList(); this.TransparentFaces = new object[1]; this.TransparentFaceCount = 0; }
// 入出庫リスト取得コールバック呼出 public override void DataSelect(int intKbn, object objList) { if ((ExWebService.geWebServiceCallKbn)intKbn == this.WebServiceCallKbn) { if (objList != null) { entityList = (ObservableCollection<EntityInOutDelivery>)objList; var records = (from n in entityList orderby n.in_out_delivery_ymd descending, n.no descending, n.in_out_delivery_kbn, n.in_out_delivery_proc_kbn select new { n.no, n.cause_no, n.in_out_delivery_ymd, n.in_out_delivery_kbn_nm, n.in_out_delivery_proc_kbn_nm, n.in_out_delivery_to_kbn_nm, n.in_out_delivery_to_nm, n.group_id_to_nm, n.customer_nm, n.purchase_name, n.sum_number }).Distinct(); this.lst.Clear(); foreach (var rec in records) { string _no = ExCast.zFormatForID(rec.no, Common.gintidFigureSlipNo); string _cause_no = ExCast.zFormatForID(rec.cause_no, Common.gintidFigureSlipNo); if (ExCast.zCLng(_cause_no) == 0) _cause_no = ""; DisplayList _displayList = new DisplayList(); _displayList.no = rec.no; _displayList.str_no = _no; _displayList.str_cause_no = _cause_no; _displayList.in_out_delivery_ymd = rec.in_out_delivery_ymd; _displayList.in_out_delivery_kbn_nm = rec.in_out_delivery_kbn_nm; _displayList.in_out_delivery_proc_kbn_nm = rec.in_out_delivery_proc_kbn_nm; _displayList.in_out_delivery_to_kbn_nm = rec.in_out_delivery_to_kbn_nm; _displayList.in_out_delivery_to_nm = rec.in_out_delivery_to_nm; _displayList.group_nm = rec.group_id_to_nm; _displayList.customer_nm = rec.customer_nm; _displayList.purchase_nm = rec.purchase_name; _displayList.sum_number = rec.sum_number; lst.Add(_displayList); } this.dg.Focus(); this.dg.ItemsSource = null; this.dg.ItemsSource = lst; this.dgSelect.ItemsSource = null; this.dgSelect.ItemsSource = lst; if (lst.Count > 0) { this.dg.SelectedIndex = 0; } ExBackgroundWorker.DoWork_Focus(dg, 10); } else { entityList = null; this.lst.Clear(); this.dg.ItemsSource = null; this.dgSelect.ItemsSource = null; ExBackgroundWorker.DoWork_Focus(this.datInOutDeliveryYmd_F, 10); } } }
public ActionCollection(DisplayList owner) : base(owner) { }
// constructors internal GridPopulatedLeafNode(GridInternalNode parent, GridBounds rectangle, StaticOpaqueObject initialStaticOpaqueObject) { this.Parent = parent; this.Rectangle = rectangle; this.BoundingRectangle = GridBounds.Uninitialized; this.VisibleLeafNodes = null; if (initialStaticOpaqueObject != null) { this.StaticOpaqueObjects = new StaticOpaqueObject[] { initialStaticOpaqueObject }; this.StaticOpaqueObjectCount = 1; } else { this.StaticOpaqueObjects = new StaticOpaqueObject[] { null }; this.StaticOpaqueObjectCount = 0; } this.DisplayList = new DisplayList(); this.TransparentFaces = new object[1]; this.TransparentFaceCount = 0; }