1. Post #281
    Gold Member
    marcin1337's Avatar
    May 2006
    893 Posts
    Ok so my program is going to connect to a SQL database;

    for it to do that it needs to know the username,password and adress.

    How easy would it be for someone to steal that info from my program?

    How can I stop that
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #282
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,502 Posts
    you're going to store the username and password inside the executable?

    uh

    Edited:

    it would be laughably easy to obtain that information
    Reply With Quote Edit / Delete Windows Vista United Kingdom Show Events Agree Agree x 3Friendly Friendly x 1 (list)

  3. Post #283
    T3hGamerDK's Avatar
    January 2011
    2,551 Posts
    Ok so my program is going to connect to a SQL database;

    for it to do that it needs to know the username,password and adress( inside the program ).

    How easy would it be for someone to steal that info from my program?

    How can I stop that
    Uh oh, this is Super Meat Boy all over again!
    Reply With Quote Edit / Delete Linux Denmark Show Events Agree Agree x 12Funny Funny x 5Friendly Friendly x 1 (list)

  4. Post #284
    Gold Member
    marcin1337's Avatar
    May 2006
    893 Posts
    you're going to store the username and password inside the executable?

    uh

    Edited:

    it would be laughably easy to obtain that information
    That's why I am asking
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  5. Post #285
    dajoh's Avatar
    March 2011
    625 Posts
    How easy would it be for someone to steal that info from my program?
    Very easy.

    How can I stop that
    Use a server between the application and the database.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Friendly Friendly x 1Agree Agree x 1 (list)

  6. Post #286
    Gold Member
    marcin1337's Avatar
    May 2006
    893 Posts
    Very easy.



    Use a server between the application and the database.
    so it would be like this.

    my program sends a request for data to a secure server( that holds SQLDatabase login ) , that secure server connects to database and gets info and sends back
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  7. Post #287
    Tamschi's Avatar
    December 2009
    3,639 Posts
    so it would be like this.

    my program sends a request for data to a secure server( that holds SQLDatabase login ) , that secure server connects to database and gets info and sends back
    Exactly. Just don't send any important or private data as plaintext over the internet and make sure the server doesn't trust the client part of the application.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Friendly Friendly x 1 (list)

  8. Post #288
    Gold Member
    marcin1337's Avatar
    May 2006
    893 Posts
    Exactly. Just don't send any important or private data as plaintext over the internet and make sure the server doesn't trust the client part of the application.
    you guys know any libs or programs to automate this?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  9. Post #289
    Tamschi's Avatar
    December 2009
    3,639 Posts
    You can use the WebRequest class with https:// urls to send secure requests to a server. (The Create method gives you a HttpWebRequest in that case.)

    It's roughly the same as sending forms from a browser. Most kinds of servers support this out of the box, but the backend needs to sanitize the request to prevent SQL injection.

    If that's not flexible enough, you can use an SslStream.
    It's more complicated as you'd have to create your own protocol, but that also means you can add things like server-client messages and better error correction more easily.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Friendly Friendly x 1 (list)

  10. Post #290
    T3hGamerDK's Avatar
    January 2011
    2,551 Posts
    I'm currently working on a game engine. Would irrlicht be sufficient for high performance 3D? I know it says so on the site, but I'd rather have external sources on this, and it seems to be pretty easy and flexible to use.
    I'll only be using the OpenGL part of the library, regardless of platform (if this helps any).
    Would it be possible to reach a playable FPS with this library, when running visuals as "pretty" as Doom 3 on their Ultra setting, or should I rather make my own renderer?
    Reply With Quote Edit / Delete Linux Denmark Show Events

  11. Post #291
    Capsup's Avatar
    April 2007
    823 Posts
    I'm currently working on a game engine. Would irrlicht be sufficient for high performance 3D? I know it says so on the site, but I'd rather have external sources on this, and it seems to be pretty easy and flexible to use.
    I'll only be using the OpenGL part of the library, regardless of platform (if this helps any).
    Would it be possible to reach a playable FPS with this library, when running visuals as "pretty" as Doom 3 on their Ultra setting, or should I rather make my own renderer?
    I'm working on a game engine myself and I went for making as much as possible from scratch. ( I did go with using GLM as the math library though. )
    If you ask me, you make a game engine solo to learn how a game engine works behind the scenes. I don't ever expect mine to compete with the real game engines such as Unity or Unreal Engine etc...
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  12. Post #292
    Nigey Nige's Avatar
    June 2010
    1,341 Posts
    I need to generate a random series of points that are a minimum distance away from each other. What's the best way to do this?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  13. Post #293
    I gave enough money to buy a soda.
    Funley's Avatar
    May 2010
    1,425 Posts
    How would i smoothly move a Vector2 to another Vector2 in XNA?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  14. Post #294
    Gold Member
    thomasfn's Avatar
    July 2008
    2,965 Posts
    How would i smoothly move a Vector2 to another Vector2 in XNA?
    Code:
    public static Vector2 Lerp(Vector2 a, Vector2 b, float mu) { return (b-a) * mu + a; }
    "a" would be the start vector, "b" would be the end vector, "mu" would be a value between 0 and 1.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  15. Post #295
    I gave enough money to buy a soda.
    Funley's Avatar
    May 2010
    1,425 Posts
    Code:
    public static Vector2 Lerp(Vector2 a, Vector2 b, float mu) { return (b-a) * mu + a; }
    "a" would be the start vector, "b" would be the end vector, "mu" would be a value between 0 and 1.
    How does the "mu" affect the movement? Speed?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  16. Post #296
    Gold Member

    March 2005
    3,028 Posts
    I need to generate a random series of points that are a minimum distance away from each other. What's the best way to do this?
    Look up "poisson disc generation"

    First result links to a simple one-page paper with a fairly straightfoward algorithm.
    Reply With Quote Edit / Delete Linux Show Events Friendly Friendly x 1 (list)

  17. Post #297
    Follow me on GitHub!
    Ziks's Avatar
    June 2011
    2,101 Posts
    How does the "mu" affect the movement? Speed?
    It's the relative position between the points. 0 is at a, 1 is at b, 0.5 is half way in between, and so on.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  18. Post #298
    I gave enough money to buy a soda.
    Funley's Avatar
    May 2010
    1,425 Posts
    It's the relative position between the points. 0 is at a, 1 is at b, 0.5 is half way in between, and so on.
    So i would have to change it when i move? How?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  19. Post #299
    Gold Member

    March 2005
    3,028 Posts
    So i would have to change it when i move? How?
    This should be pretty obvious, I think.
    Mu controls the position between point a and point b. You want to move from a to b over some period of time. So mu is going to be some function of time. Setting mu=t-t[sub]0[/sub] (in seconds, where t[sub]0[/sub] is the initial time) means that mu will go from 0 to 1 in only 1 second. Now how do you make that time longer or shorter? Simple. You multiply or divide by some constant. So if you want to move from a to b over a period of five seconds, then you would set mu=(t-t[sub]0[/sub])/5
    Reply With Quote Edit / Delete Linux Show Events

  20. Post #300
    own-fucking-zone
    Within's Avatar
    April 2009
    4,016 Posts
    In .NET, how can I get InnerHtml based on class names?
    I'm interested in getting the HTML from the tip-container class, as shown below:

    <div class="tip-container">
      <article class="tip tip-color-15 splash" id="tip_1423">
      
        <h1 unselectable="on">brotip #1415</h1>
        <p unselectable="on">ladies, guys are sick of <br> hearing you ask where <br> all of the "nice guys" are. <br> they're in the friend zone, <br> where you left them.</p>
    
        <footer unselectable="on" class="tip-footer"></footer>
        <footer unselectable="on" class="tip-copyright">brotips.com</footer>
      
      </article>
    </div>

    GetElementById doesn't work for classes (obviously). I can't predict the tip_x ID (since for some reason it doesn't follow the tip number as shown on the page), so I can't use that to GetElementById
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Funny Funny x 1 (list)

  21. Post #301
    Gold Member
    Octave's Avatar
    January 2009
    2,530 Posts
    Well in javascript you can do getElementByClass, so if c# dom is similar that might just work
    Reply With Quote Edit / Delete United States Show Events

  22. Post #302
    Nigey Nige's Avatar
    June 2010
    1,341 Posts
    Look up "poisson disc generation"

    First result links to a simple one-page paper with a fairly straightfoward algorithm.
    Thanks!

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  23. Post #303
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    In .NET, how can I get InnerHtml based on class names?
    I'm interested in getting the HTML from the tip-container class, as shown below:

    <div class="tip-container">
      <article class="tip tip-color-15 splash" id="tip_1423">
      
        <h1 unselectable="on">brotip #1415</h1>
        <p unselectable="on">ladies, guys are sick of <br> hearing you ask where <br> all of the "nice guys" are. <br> they're in the friend zone, <br> where you left them.</p>
    
        <footer unselectable="on" class="tip-footer"></footer>
        <footer unselectable="on" class="tip-copyright">brotips.com</footer>
      
      </article>
    </div>

    GetElementById doesn't work for classes (obviously). I can't predict the tip_x ID (since for some reason it doesn't follow the tip number as shown on the page), so I can't use that to GetElementById
    what are you doing
    Reply With Quote Edit / Delete Mac Australia Show Events Agree Agree x 1 (list)

  24. Post #304
    Gold Member
    DesolateGrun's Avatar
    July 2008
    6,269 Posts


    I have a little VB2010 game i'm making
    (please don't say anything about it, I need to take this class in order to go to java next year)
    1.Is there anything I can do with the transparency settings, if I set the pictureboxes to be transparent the border of the image is still blocking the back.

    2. What would i use in order to make the keys flash at random and require a keypress to shut them off?

    3. is there a possible way to make the screen sidescroll with the character without scroll bars
    I have double buffer for the form on all it did was make it smoother
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  25. Post #305
    DestWa's Avatar
    September 2007
    204 Posts
    Sorry to bother you all but I would like to find a good Java LWJGL tutorial series?
    I've been trying to google for one for some time. I can just find some really basic ones that don't go indepth on all the Open gl stuff.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  26. Post #306
    Gold Member
    subenji99's Avatar
    May 2005
    3,572 Posts
    Code:
    public static Vector2 Lerp(Vector2 a, Vector2 b, float mu) { return (b-a) * mu + a; }
    "a" would be the start vector, "b" would be the end vector, "mu" would be a value between 0 and 1.
    You don't need to program this, C# provides it as MathHelper.Lerp().
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1Informative Informative x 1 (list)

  27. Post #307
    Gold Member
    ThePuska's Avatar
    October 2005
    3,450 Posts
    I'm trying to hook the KeyboardProc of an app, but I can't seem to do it. The program just freezes when it receives keyboard input.

    I haven't really dealt with DLLs or hooking before so I barely understand what I'm doing

    Here's how I install the hook (I removed the checks that ensure that the handles etc. are all OK - they are):

    char *dllName = "full path to .dll";
    char *procName = "_KeyboardP@12";
    char *targetName = "Untitled - Notepad";
    
    HWND targetWindow = 0;
    DWORD targetThreadId = 0;
    
    HOOKPROC hHookP = 0;
    HINSTANCE hDll = 0;
    HHOOK hHook = 0;
    
    hDll = LoadLibrary(dllName);
    hHookP = (HOOKPROC)GetProcAddress(hDll, procName);
    
    targetWindow = FindWindow(0, targetName);
    targetThreadId = GetWindowThreadProcessId(targetWindow, 0);
    
    hHook = SetWindowsHookEx(WH_KEYBOARD, hHookP, hDll, targetThreadId);

    Here's the hook in a .DLL:

    __declspec(dllexport) LRESULT WINAPI KeyboardP(int nCode, WPARAM wParam, LPARAM lParam)
    {
        return CallNextHookEx(0, nCode, wParam, lParam);
    }
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Informative Informative x 1 (list)

  28. Post #308
    The Kakistocrat's Avatar
    November 2011
    1,353 Posts
    edit: read through some of the documentation, found my problem.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  29. Post #309
    Chrispy_645's Avatar
    November 2010
    449 Posts
    In .NET, how can I get InnerHtml based on class names?
    I'm interested in getting the HTML from the tip-container class, as shown below:

    <div class="tip-container">
      <article class="tip tip-color-15 splash" id="tip_1423">
      
        <h1 unselectable="on">brotip #1415</h1>
        <p unselectable="on">ladies, guys are sick of <br> hearing you ask where <br> all of the "nice guys" are. <br> they're in the friend zone, <br> where you left them.</p>
    
        <footer unselectable="on" class="tip-footer"></footer>
        <footer unselectable="on" class="tip-copyright">brotips.com</footer>
      
      </article>
    </div>

    GetElementById doesn't work for classes (obviously). I can't predict the tip_x ID (since for some reason it doesn't follow the tip number as shown on the page), so I can't use that to GetElementById
    What I did was, instead of using the default shit that .NET has, use this instead:
    http://htmlagilitypack.codeplex.com/

    It's a DLL so you'll have to add a reference to it in your project in VS. I found it very easy to use and I used it for some web scraping of my own.
    Reply With Quote Edit / Delete Windows 7 New Zealand Show Events

  30. Post #310
    Clops with bisousbisous daily <3
    Mr. Smartass's Avatar
    December 2010
    9,188 Posts
    I'm trying to load and draw two textured models in XNA, but it shoots back the error "Object refrence not set to an instance of an object" on this line of code; "meshPart.Effect = effect.Clone();"
    private Model loadModel(string assetName, out Texture2D[] textures)
            {
                Model newModel = Content.Load<Model>(assetName);
                textures = new Texture2D[newModel.Meshes.Count];
                int i = 0;
                foreach (ModelMesh mesh in newModel.Meshes)
                    foreach (BasicEffect currentEffect in mesh.Effects)
                        textures[i++] = currentEffect.Texture;
    
                foreach (ModelMesh mesh in newModel.Meshes)
                    foreach (ModelMeshPart meshPart in mesh.MeshParts)
                       meshPart.Effect = effect.Clone();
    
                return newModel;
            }
    
    
            //draws the starbox
            private void drawSkyBox()
            {
                SamplerState ss = new SamplerState();
                ss.AddressU = TextureAddressMode.Clamp;
                ss.AddressV = TextureAddressMode.Clamp;
                device.SamplerStates[0] = ss;
    
                DepthStencilState dss = new DepthStencilState();
                dss.DepthBufferEnable = false;
                device.DepthStencilState = dss;
               
                Matrix[] starboxTransforms = new Matrix[starboxModel.Bones.Count];
                starboxModel.CopyAbsoluteBoneTransformsTo(starboxTransforms);
                int i = 0;
                foreach (ModelMesh mesh in starboxModel.Meshes)
                {
                    foreach (Effect currentEffect in mesh.Effects)
                    {
                        Matrix worldMatrix = starboxTransforms[mesh.ParentBone.Index];
                        currentEffect.CurrentTechnique = currentEffect.Techniques["Textured"];
                        currentEffect.Parameters["xWorld"].SetValue(worldMatrix);
                        currentEffect.Parameters["xView"].SetValue(viewMatrix);
                        currentEffect.Parameters["xProjection"].SetValue(projectionMatrix);
                        currentEffect.Parameters["xTexture"].SetValue(starBoxTextures[i++]);
                    }
                    mesh.Draw();
                }
                dss = new DepthStencilState();
                dss.DepthBufferEnable = true;
                device.DepthStencilState = dss;
    
            }
    
    
    
            private void drawWeapon()
            {
                SamplerState ss = new SamplerState();
                ss.AddressU = TextureAddressMode.Clamp;
                ss.AddressV = TextureAddressMode.Clamp;
                device.SamplerStates[0] = ss;
    
                DepthStencilState dss = new DepthStencilState();
                dss.DepthBufferEnable = true;
                device.DepthStencilState = dss;
                //Matrix worldMatrix = weaponPositionMatrix;
    
                Matrix[] weaponTransforms = new Matrix[shipModel.Bones.Count];
                shipModel.CopyAbsoluteBoneTransformsTo(weaponTransforms);
                int i = 0;
                foreach (ModelMesh mesh in shipModel.Meshes)
    
                {
                    //sets the effects for all meshes in the model
                    foreach (Effect currentEffect in mesh.Effects)
                    {
                        worldMatrix = weaponTransforms[mesh.ParentBone.Index];
                        currentEffect.CurrentTechnique = currentEffect.Techniques["Textured"];
                        currentEffect.Parameters["xWorld"].SetValue(weaponTransforms[mesh.ParentBone.Index] * worldMatrix);
                        currentEffect.Parameters["xView"].SetValue(viewMatrix);
                        currentEffect.Parameters["xProjection"].SetValue(projectionMatrix);
                        currentEffect.Parameters["xEnableLighting"].SetValue(true);
                        currentEffect.Parameters["xLightDirection"].SetValue(sunAngle);
                        currentEffect.Parameters["xTexture"].SetValue(grenadeLauncherTextures[i++]);
                        currentEffect.Parameters["xAmbient"].SetValue(0.5f);
                    }
                    mesh.Draw();
                }
            }
    

    It was working fine until I decided to do some late night editing, and I have no idea what went wrong. Can anyone help me?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  31. Post #311
    Wyzard's Avatar
    June 2008
    1,243 Posts
    Your "effect" variable is null. Where is that variable defined? It isn't mentioned anywhere else in the code you posted.
    Reply With Quote Edit / Delete Linux United States Show Events Agree Agree x 1 (list)

  32. Post #312
    Gold Member
    toaster468's Avatar
    January 2010
    3,260 Posts
    I have some knowledge in Java so would it be possible to use this http://code.google.com/p/kryonet/ library to make a little console chat applet?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  33. Post #313
    Gold Member
    Blueridge's Avatar
    July 2008
    2,320 Posts
    What's a clear way of removing multiple elements in an array?

    For a school assignment I have to make a class that holds an array of integers, and add methods that add to it, remove etc. Kinda like an ArrayList. The problem, however, is they want me to make a removeAll(int val) method that removes all occurrences of val from the list. For example, removeAll(4) would change

    {1, 2, 4, 6, 3, 4, 4, 6, 5, 6, 4} to
    {1, 2, 6, 3, 6, 5, 6, 0, 0, 0, 0}.

    For my regular remove() method, I'm using Apache Common's Lang ArrayUtils class to remove the element. Removing all elements with it doesn't work fully, for some reason. My current plan of attack is to find out how many times val appears in the array, and then call ArrayUtils.remove() that many times. But it gives me weird results, for instance shrinking the array. Any other way to attack this? I can't use ArrayList supposedly, and I doubt they'll check if I am or not, but it would be nice to figure out how to do this the way they want me to.
    This is what I've come up with:

    Code:
      public void removeAll(int val) {
        int read = 0, write = 0, loop = 0;
        boolean hasNum = false;
       
        while(read <list.length) {
          if(list[read] == val)
          {
            read++;
            list[write] = list[read];
            hasNum = true;
          }
          read++;
          write++;
        }
       
        if(hasNum && read >= list.length) {
          while(write < list.length) {
            list[write] = 0;
            write++;
        }
        }
      }
     
    public class IntegerListTest
    {
      static IntegerList list;
      public static void main(String[]args)
      {
        list = new IntegerList(10);
        int[] test = {1, 4, 6, 4, 2, 6, 4, 6, 7, 6};
        //expected:  {1, 6, 2, 6, 6, 7, 6, 0, 0, 0}
        list.add(test);
        list.removeAll(4);
       
        list.print();
      }
    }
    And here's what I got instead of what was expected:
    0: 1
    1: 6
    2: 2
    3: 4
    4: 6
    5: 6
    6: 4
    7: 6
    8: 0
    9: 0

    This time it gets 1 of the 4s(the first one), but not all of them. Not sure what I'm getting wrong here.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #314
    Gold Member
    ThePuska's Avatar
    October 2005
    3,450 Posts
    This is what I've come up with:

    Code:
      public void removeAll(int val) {
        int read = 0, write = 0, loop = 0;
        boolean hasNum = false;
       
        while(read <list.length) {
          if(list[read] == val)
          {
            read++;
            list[write] = list[read];
            hasNum = true;
          }
          read++;
          write++;
        }
       
        if(hasNum && read >= list.length) {
          while(write < list.length) {
            list[write] = 0;
            write++;
        }
        }
      }
     
    public class IntegerListTest
    {
      static IntegerList list;
      public static void main(String[]args)
      {
        list = new IntegerList(10);
        int[] test = {1, 4, 6, 4, 2, 6, 4, 6, 7, 6};
        //expected:  {1, 6, 2, 6, 6, 7, 6, 0, 0, 0}
        list.add(test);
        list.removeAll(4);
       
        list.print();
      }
    }
    And here's what I got instead of what was expected:
    0: 1
    1: 6
    2: 2
    3: 4
    4: 6
    5: 6
    6: 4
    7: 6
    8: 0
    9: 0

    This time it gets 1 of the 4s(the first one), but not all of them. Not sure what I'm getting wrong here.
    void remove_array(int *list, int count, int value)
    {
    	int read = 0, write = 0;
    
    	while (read < count)
    	{
    		while ((read < count) && (list[read] == value)) read++;
    		if (read < count)
    			list[write] = list[read];
    		write++;
    		read++;
    	}
    
    	while (write < count)
    	{
    		list[write] = 0;
    		write++;
    	}
    }

    Edited:

    Your idea of having two running indices, one for reading and one for writing was a good one. I imagine my snippet is more like you intended it in your head
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  35. Post #315
    Gold Member
    Blueridge's Avatar
    July 2008
    2,320 Posts
    void remove_array(int *list, int count, int value)
    {
    	int read = 0, write = 0;
    
    	while (read < count)
    	{
    		while ((read < count) && (list[read] == value)) read++;
    		if (read < count)
    			list[write] = list[read];
    		write++;
    		read++;
    	}
    
    	while (write < count)
    	{
    		list[write] = 0;
    		write++;
    	}
    }

    Edited:

    Your idea of having two running indices, one for reading and one for writing was a good one. I imagine my snippet is more like you intended it in your head
    Converted it to Java. It sets the first appearance of 4 to 0, and then keept every other element the same.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  36. Post #316
    Clops with bisousbisous daily <3
    Mr. Smartass's Avatar
    December 2010
    9,188 Posts
    Your "effect" variable is null. Where is that variable defined? It isn't mentioned anywhere else in the code you posted.
    Whups, sorry. It's defined at the top as
     Effect effect;
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  37. Post #317
    Gold Member
    marcin1337's Avatar
    May 2006
    893 Posts
    Can a programmer be liable for the program he makes?

    I'm making a program that checks a auction site every 5 min and emails a list of people in a text file all auctions with trucks
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #318
    Wyzard's Avatar
    June 2008
    1,243 Posts
    Whups, sorry. It's defined at the top as
     Effect effect;
    That'll default to null since it's not initialized with a value. Chances are, you're using it without having assigned a value to it yet.
    Reply With Quote Edit / Delete Linux United States Show Events

  39. Post #319
    Clops with bisousbisous daily <3
    Mr. Smartass's Avatar
    December 2010
    9,188 Posts
    That'll default to null since it's not initialized with a value. Chances are, you're using it without having assigned a value to it yet.
    Nope, before the model draw calls I have this
    protected override void LoadContent()
            {
                spriteBatch = new SpriteBatch(GraphicsDevice);
                device = graphics.GraphicsDevice;
                shipModel = loadModel("grenadelauncher", out grenadeLauncherTextures);
                effect = Content.Load<Effect>("effects");
                starboxModel = loadModel("starbox", out starBoxTextures);
                font = Content.Load<SpriteFont>("font");
                
            }
    
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  40. Post #320
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Nope, before the model draw calls I have this
    protected override void LoadContent()
            {
                spriteBatch = new SpriteBatch(GraphicsDevice);
                device = graphics.GraphicsDevice;
                shipModel = loadModel("grenadelauncher", out grenadeLauncherTextures);
                effect = Content.Load<Effect>("effects");
                starboxModel = loadModel("starbox", out starBoxTextures);
                font = Content.Load<SpriteFont>("font");
                
            }
    
    Put a break point on that line and ensure that Content.Load<EFfect>("effects"); isn't returning null.
    Reply With Quote Edit / Delete Windows 7 United States Show Events