Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

194 Neutral

About maya18222

  • Rank
  1. maya18222

    Tortoise SVN Questions

    I've been playing about with tortoise svn and have a few questions.   In the case where I have created a trunk, and then copied that to a branch, modified some files in the trunk, and commited those trunk changes.   Case 1: Step A) I merge from trunk to branch using "merge a range of revisions" with the "revision range to use" left blank, all goes well and I see the latest chnages from trunk in the branch, with the branch folder now having the red icon as expected. I then commit those changes in the branch and the branch icon turns green.   Step B) Without modifying anything, I thought I'd see what happens if I try merging from trunk to branch again. I expected nothing to happen as no further changes have been made. Yet, merging from trunk to branch again with "merge a range of revisions" with the "revision range to use" left blank causes the branch icon to again turn red. I didn't expect this, as no files have been changed. If I right click the branch and view "check for modifications" I see that the folder has a "property change"?   Case 2: If I do the exact same thing, but this time not leaving the "revision range to use" blank, but instead selecting the revisions where the files changed. Step A) gives the same results, but Step B) now works as I would expect, in that the branch remains with its green icon and there are no changes.   Can someone explain the behaviour in the first case?   secondly, if I'm wanting to periodcially merge from branch to trunk, should I be using "Merge a range of revisions" or "Reintegrate branch"?
  2. If I have a datatemplate that will end up using a scrollbar in one form or another, how can I retain the scrollbars position when the datacontext changes back and forth? I've read that you generally store the state of the UI in the ViewModel. This makes sense for things like selected item, or is expanded type states, but Im not sure how to apply it to the scrollbar state. As in general, the scrollbar will automatically appear disappear. Ive posted an example of what I mean below. When you select a tab and move the scrollbar, then select another tab and move its scrollbar. Upon returning to the first tab, the scrollbar has moved. I believe this is due to the View being shared, and so it retains the percentage scrolled from the previous view?   <Window x:Class="WpfApplication13.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <TabControl ItemsSource="{Binding Data}"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Count}"/> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTemplate> <ListBox ItemsSource="{Binding}"/> </DataTemplate> </TabControl.ContentTemplate> </TabControl> </Window> namespace WpfApplication13 { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Data = new List<string[]>(); for (int i = 1; i < 10; ++i) { string[] strings = new string[i * 10]; for (int j = 0; j < i * 10; ++j) { strings[j] = new string('z', 100); } Data.Add(strings); } DataContext = this; } public List<string[]> Data { get; set; } } }  
  3. Thank you for the replies. Im actually trying to come up with a way of updating winForms controls in a wpf application at a rate of several hundred FPS. My first approach was just DispatcherTimer dt = new DispatcherTimer(); dt.Interval = TimeSpan.FromMilliseconds(1); dt.Tick += new EventHandler(OnProcessViewports); dt.Start(); which as mentioned, gives me arounf 60 FPS. Ive now tried Loaded += (s, a) => { BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (ss, aa) => { while (true) { Thread.Sleep(16); Dispatcher.Invoke(new EventHandler(OnProcessViewports), new object[] { null, null }); } }; bw.RunWorkerAsync(); }; This works, and gives me several hundred FPS (with a low sleep time), which is what I wanted. But, something odd is happeneing with the CPU usage. If I set the sleep time to about 16ms, then I get around ~55FPS, but, .. the CPU usage goes to about 20-30%. using the dispatch timer approach as coded above, I get 60 FPS, and around 2-3% CPU usage. Any ideas why this would be the case? Both versions run at around 60FPS, yet the 2nd approach uses a lot more CPU usage.
  4. I'm trying to devise a way of a getting some kind of timer to signal an event in my WPF application with an interval of around 5ms. My attempts with using a DispatchTimer or a Timer and having the interval set to 1ms, lead to their "tick" events being triggered at only around 60 times a second, which isnt fast enough. Is there any way I can achieve something faster? either through some event mechanism or by any other means? I would like something similar to that of a win32 application, as shown below. int Application::run(){ while(msg.message != WM_QUIT) { if(PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) // If there are Window messages then process them. { TranslateMessage( &msg ); DispatchMessage( &msg ); } else // Otherwise, do my work { } return (int)msg.wParam;} I assume this is how WPF is doing it in the background with its Application.Run(Window()) method. Is there anyway of getting some kind of callback on that "else" branch?
  5. Is this possible? I tried it with the DX api math library and it doesnt work as expected, so is there anyway of adapting the creation of of the perspective matrix? The reason Im asking is because Im trying to draw lines that are drawn by transforming 3d points by a viewProj matrix, and then sending the XY values to a 2D line drawing library. This creates problems when one of the 3d points defining a line is behind the camera. I could solve this by "sliding" the vertices to clip with the view frustum in 3d space, but im hoping the above would be an easier approach. Im not using the depth either, so precision isnt a problem. Any ideas?
  6. If I have 2 computers connected to the same router/switch, is it possible to write an application that can be running on both so that they can discover each other with only knowing a port number? I havent really done much socket programming, but from what Ive done you usually have the server listening for connections on some port and the client is able to connect to the server by knowing the ip of the server and the appropiate port to send the request to. How can I set it up so that clients can still connect to the server, .. but without knowing the servers IP? Would it be a case of just repeatedley sending requests to a range of address you know the server could be on? or is there a better way?
  7. If you were to use Datatemplates to separate UI from data, such as the following - namespace WpfApplication1 { partial class Data { public string SomeData { get; set; } } public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Data d = new Data(); d.SomeData = "SomeValue"; Content = d; } } } //=============================== <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" x:Class="WpfApplication1.Data"> <DataTemplate DataType="{x:Type local:Data}"> <Button Content="{Binding Path=SomeData}"/> </DataTemplate> </ResourceDictionary> How would you then handle events on that Data template? Say for example I wanted to perform some task on the SomeData property in response to the button being clicked.
  8. maya18222

    WPF : How is this code working?

    Ah, I see. I didnt realise it was doing stuff behind the scenes like that.
  9. maya18222

    WPF : How is this code working?

    Yes but both the ContentControl and the listbox are being bound to an ObservableCollection. All the ContentControl sees is the ObservableCollection. How is it somehow seeing the current item in the listbox/Selector/Items.
  10. Taken from one of the MSDN examples : http://msdn.microsoft.com/en-us/library/aa970558.aspx I don't understand how the information in the lower three textboxes of the ContentControl stays synced up with the current selection in the list box. The binding for the ContentControl is bound to an ObservableCollection, which doesnt have any "CurrentItem" functionality. So what is the "IsSynchronizedWithCurrentItem" doing to make this all work?
  11. so you're able to select a RTV or DSV, and still see the scene being constructed in those views as you flip through draw calls that render into those views? Are you also able to see the depth buffer? Edit - I've managed to view the depth buffer to some extent, by selected the DSV Tex2D resource, and then setting the Colour format to some kind of floating point format in the image properties window, ...but its still not really useable, as apparently all image editing is done in 8bits per channel, not floating point. [attachment=11300:Untitled.jpg]
  12. I was kinda hoping you could select the depth or colour target object as the current object, and then be able to see the each draw call being rendered onto the buffer as you click over drawcall commands. However, if I do this, I dont see anything, just the clear colour for the colour target, and the checkboard pattern for the depth target. Anyone got this to work?
  13. One of my shaders wasn't producing the results I wanted and so I check it out with PIX and got underscores for some of the components. I assume this means that the data is invalid? nan? View and Proj are paramaters passed in through a cbuffer, and the data is definately ok on the C++ side, right before I update the the cbuffer. Any ideas? [attachment=11169:Untitled.jpg]
  14. maya18222

    Visual Studio C#

    But lets say you're working on a project with lots of references, and if as you say, you just set the debug references, but having to change these to the release versions each time you want to build a release version (which could be quite often, especially if you're keeping track on performance), is a real pain.
  15. 1. How do you set your project to refer to different references based on the build mode? For example, how do I reference "Libs\someDebugLib.dll" in my debug build and "Libs\someReleaseLib.dll" in my release build 2. How come when using .net libraries you dont have to select debug or release versions? ... is the correct one being chosen under the hood? .. if so, how?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!