Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

494 Neutral

About Krisc

  • Rank
  1. I posted this question on stack overflow and got an answer that was somewhat satisfactory. But the answer wasn't very in depth. I attempted to get the ViewModel solution to work, but it was met with an error. Essentially I have a model object like so... public class Entry{ public User Author { get; set; } } ...where the User property "Author" should be represented as a drop down of users only when editing the Entry item. I have been able to get the dropdown to appear when using the ViewModel pattern, but the reverse process doesn't seem to happen because MVC can't turn the string value into a User object. This is obvious to me, because the object isn't stored in the HTML, but I feel as though I am missing a crucial step. If the ViewModel attempts to abstract the back-and-forth code necessary to represent the User collection as a dropdown, that is fine albeit a little unnecessary. I had previously thought the ViewModel pattern was used for cases like this and allowed for somewhat of an automagic way of editing composite types with complex child properties. My ViewModel has essentially been the following: public class EntryViewModel{ public EntryViewModel(){ Users = new SelectList( /* fill with users from EDM */ ); } public Entry Entry { get; set; } public SelectList Users { get; set; } }
  2. Quote:Original post by CDProp Oh, ok. Is that pretty much what you would do in this situation? Just have a team-wide standard that relative paths must match? That is what I do and it has been working well so far. I have my framework project that outputs some DLLs. I then have a PowerShell script that copies the necessary files out to project folders in a subfolder labeled "Libraries" and then by platform (x86, x64, Zune, Xbox 360). One question I have is why are A and B relying on different versions of a library (X) that is under development. I can understand the scenario in terms of a third party library that hasn't changed or has introduced breaking changes. Here A may be a maintained legacy app where as B is a new app that utilizes the new code. But if you were developing A and B at the same time as X, then why are they using different versions?
  3. I am working on a stroke shader to try and get a thin line around the edge of a rendered image. The problem is that the stroke "falloff" isn't working. It seems to be either on or off rather than a measure of any distance (for example distance from the edge). I have been modifying a shader I found on the web for edge detection. Ideally I would like a shader that has a gradient falloff as well as the ability to do a thin stroke. I seem to be able to do neither. So far I have controlled the stroke thickness with the Offset, but it only works up to a certain point. I am also using the shader to do stencil tests. uniform extern texture ColorTexture; uniform extern texture StencilTexture; uniform extern float Offset = 1.0 / 1024.0; sampler2D ColorSampler = sampler_state { Texture = (ColorTexture); MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; }; sampler2D StencilSampler = sampler_state { Texture = (StencilTexture); MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; }; float GetEdge(float2 texCoord: TEXCOORD) : COLOR { // Sample neighbor pixels float s00 = tex2D(StencilSampler, texCoord + float2(-Offset, -Offset)).r; float s01 = tex2D(StencilSampler, texCoord + float2( 0, -Offset)).r; float s02 = tex2D(StencilSampler, texCoord + float2( Offset, -Offset)).r; float s10 = tex2D(StencilSampler, texCoord + float2(-Offset, 0)).r; float s12 = tex2D(StencilSampler, texCoord + float2( Offset, 0)).r; float s20 = tex2D(StencilSampler, texCoord + float2(-Offset, Offset)).r; float s21 = tex2D(StencilSampler, texCoord + float2( 0, Offset)).r; float s22 = tex2D(StencilSampler, texCoord + float2( Offset, Offset)).r; float scale = 0.125; // Sobel filter in X direction float sobelX = s00 + scale * s10 + s20 - s02 - scale * s12 - s22; // Sobel filter in Y direction float sobelY = s00 + scale * s01 + s02 - s20 - scale * s21 - s22; float edgeSqr = sqrt(sobelX * sobelX + sobelY * sobelY); //return edgeSqr; } float4 StencilPS(float2 TexCoords : TEXCOORD0) : COLOR0 { float4 FinalColor; float2 samp = TexCoords; FinalColor = tex2D(ColorSampler, samp); FinalColor.a = tex2D(StencilSampler, samp).r; float Edge = GetEdge(TexCoords); if(Edge > 0.0) FinalColor = float4(0, 0, 0, Edge / 4); return FinalColor; } technique Stencil { pass P0 { PixelShader = compile ps_2_0 StencilPS(); } } Here are the results...
  4. Krisc

    What is, and How to Do XNA

    XNA can mean any of a few things. XNA is all of Microsoft's game and graphics division, including the XNA Framework and DirectX. The XNA Framework is one thing you can use to develop games for Windows, Zune and/or the 360. To use XNA FX, visit http://creators.xna.com which will tell you how to get the 3.0 beta. Roughly you will need XNA, Visual C# 2008 (Express or Standard+) and .NET.
  5. Krisc

    C# ? SlimDX, XNA

    XNA has a lot more than just rendering since it also ties into the Xbox Live core including gamer profiles, Live networking, etc.
  6. Thanks for the name change! :D
  7. Krisc

    InteliShade 2008 HLSL Add-on

    Awesome work man!
  8. Well, I found out that when using a label it creates a span in the html which is illegal since it contains divs. So I went another route. I now have a div in the master file with a runat="server" tag so I can set the inner html from the code.
  9. I have the following setup... Master.master: - content stuff BasePage : Page - Label, ID=MainLabel - Code that does MainLabel.Text = "..." <%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ContentPage.aspx.cs" Inherits="FocusedGames.ContentPage" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <asp:Label ID="MainLabel" runat="server" Text="Hello" /> </asp:Content> <asp:Content ID="Content3" ContentPlaceHolderID="MainColumn" runat="server"> </asp:Content> ChildPage : BasePage <%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Blog.aspx.cs" Inherits="FocusedGames.Blog" Title="Focused Games - Blog" %> If I go to BasePage.aspx, everything works as expected. However, whenever I goto ChildPage.aspx, it throws a null reference on MainLabel.
  10. Krisc

    Help me understand CPU/RAM/FSB...

    I don't really see the necessity of 10k drives. They are loud and expensive. I rather buy a reliable low cost solution and wait for SSD drives to come down in price. Thanks for the help fellas. I went with a Q6600 and 4gb of DDR2 800. I simply couldn't find the E8400 anywhere.
  11. Krisc

    Help me understand CPU/RAM/FSB...

    Ok, but it seems that DDR2 doesn't go to 1333, unless I am misunderstanding the naming scheme. So does that mean to get 1333mhz I need to goto DDR3? Edit... Like this motherboard here which says it supports 1600mhz/1333mhz but also states it wants DDR2 1200...
  12. I have posted similar questions in different places and have gotten equally confusing results. Some say that you have to match the FSB with your RAM's MHZ rating and some say you don't. I have no idea who to believe anymore, hopefully someone can bring some closure to this issue for me. Here is what I posted on AnandTech... "I am looking to build an E8400 based desktop (if I can find one for sale anywhere!) but am having trouble understanding a lot of the randomly named motherboards and RAM. For instance, when a motherboard reads DDR2 1200 standard, does that mean it requires DDR2 1200? Also, the E8400 states a 1333mhz FSB but after sifting through some threads on this site it seems that most people go with DDR2 800, even on motherboards that read DDR2 1066/1200 standard. So is it okay to go with DDR2 800?" So with a 1333 FSB cpu like the E8400 do I need 1333mhz rated RAM? Thanks!
  13. System.IO.File.Exists(path) will work for the first one. You can also use methods in System.IO.Path like System.IO.Path.GetDirectory(). You can also get the extension that way. To find out if the file is a plain text file, you would probably have to look at the header or something. Look more into the System.IO.File type, it may have what you need.
  14. I want to be able to open a file in an application and then be able to open further files from the OS into that instance of the application. I can get the process that is running and make sure that only one instance runs, but am having trouble sending it the file to open. I am using WinForms, but can use the .net 3.5 stuff.
  • 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!