1. Post #2601
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,677 Posts
    Anyone mind telling me if this draws anything other than a red screen? http://db.tt/cA04eKaQ
    Segfaults for me.
    Reply With Quote Edit / Delete Linux United States Show Events

  2. Post #2602
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Anyone mind telling me if this draws anything other than a red screen? http://db.tt/cA04eKaQ
    Crashes with an exception.



    I'm running on GTX560 Ti, latest beta drivers.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  3. Post #2603
    Richy19's Avatar
    May 2010
    5,375 Posts
    ARGHHHHHHH god damn ittttt, I have no idea why this is happening.
    Heres the source if anyone is bored and has a free moment :( Im giving up on programming for the next hour going for dinner instead
    I sware once i get back to my desktop im just going to use slimDX...
    http://dl.dropbox.com/u/18453712/opentkgaem.zip
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  4. Post #2604
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Red screen, no crash when I compile it myself
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  5. Post #2605
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    Alright, have you already built and placed GLFW in the correct folder (include and lib directories)?
    What do you mean by built?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #2606

    January 2012
    414 Posts
    Anyone mind telling me if this draws anything other than a red screen? http://db.tt/cA04eKaQ
    No problem, it draws a dropbox 404 file not found error
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  7. Post #2607
    Richy19's Avatar
    May 2010
    5,375 Posts
    No problem, it draws a dropbox 404 file not found error
    My bad deleted it when i uploaded the source

    Edited:

    Red screen, no crash when I compile it myself
    I removed the skybox and added text, styll i take it its not showing
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  8. Post #2608
    BAZ
    Dav0r, buy me a custom title. I'm far too poor ;_;
    BAZ's Avatar
    July 2005
    12,599 Posts
    Am I right in understanding that it's generally a good practise to keep graphics renderers separate from the application so you can switch between an openGL/DX renderer for example?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 5 (list)

  9. Post #2609
    Richy19's Avatar
    May 2010
    5,375 Posts
    Surelly with this ortho setup:

    MVP = Matrix4.CreateOrthographicOffCenter(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 2.0f);

    where the screen is:
    Code:
    0 - 0                                       1 - 0 
    ----------------------------------------------
    |                                            |
    |                                            |
    |                                            |
    |                                            |
    |                                            |
    ---------------------------------------------
    0 - 1                                     1 - 1
    And these verticies:
    float[] vertices = {	0.5f,	0.0f,	1.0f,	
    				0.0f,	-1.0f,	1.0f,
    				1.0f,	1.0f,	1.0f };
    

    The triangle should be right in the midle of the screen, well for some reason it isnt.
    I know that its drawing it because I got the triangle to draw earlier when I was using just the x,y of the verticies but changing the size of GL.VertexAttribPointer from 2 to 3 has made it not draw anymore.

    Heres all the code encase its something other than positioning
    // Released to the public domain. Use, modify and relicense at will.
    using System;
    
    using OpenTK;
    using OpenTK.Graphics;
    using OpenTK.Graphics.OpenGL;
    using OpenTK.Audio;
    using OpenTK.Audio.OpenAL;
    using OpenTK.Input;
    
    namespace StarterKit
    {
    	class Game : GameWindow
    	{
    		
    		float[] vertices = {	0.5f,	0.0f,	1.0f,	
    								0.0f,	1.0f,	1.0f,
    								1.0f,	1.0f,	1.0f };
    		int vbo;
    		string fragmentSource = "#version 120\n" +
    						"void main(){gl_FragColor = vec4(1.0f, 0.0f, 0.0f, 1.0f);}";
    		
    		string vertexSource = "#version 120 \n" +
    						"uniform mat4 MVP;	attribute vec4 Position;" +
    						"void main(){	gl_Position =  MVP * Position;	}";
    		
    		int shaderProgram, vertexShader, fragmentShader;
    		int MVPID, PositionID;
    		
    		Matrix4 MVP;
    		
    		/// <summary>Creates a 800x600 window with the specified title.</summary>
    		public Game ()
                : base(800, 600, GraphicsMode.Default, "OpenTK Quick Start Sample")
    		{
    			VSync = VSyncMode.On;
    		}
    		
    		protected override void OnDisposed(EventArgs e)
    		{
    			
    			GL.DetachShader( shaderProgram, vertexShader );
    			GL.DetachShader( shaderProgram, fragmentShader );
    			
    			GL.DeleteShader(vertexShader);
    			GL.DeleteShader(fragmentShader);
    			
    			GL.DeleteProgram(shaderProgram);
    			
    			GL.DeleteBuffers(1, ref vbo);
    			
    			base.OnDisposed(e);
    		}
    		
    		/// <summary>Load resources here.</summary>
    		/// <param name="e">Not used.</param>
    		protected override void OnLoad (EventArgs e)
    		{
    			base.OnLoad (e);
    
    			GL.ClearColor (0.1f, 0.2f, 0.5f, 0.0f);
    			GL.Enable (EnableCap.DepthTest);
    			
    			
    			
    			
    			
    			GL.GenBuffers (1, out vbo);
    			GL.BindBuffer (BufferTarget.ArrayBuffer, vbo);
    			GL.BufferData (BufferTarget.ArrayBuffer, (IntPtr)(vertices.Length * sizeof(float)), vertices, BufferUsageHint.StaticDraw);
    		
    			vertexShader = GL.CreateShader(ShaderType.VertexShader);
    			GL.ShaderSource( vertexShader, vertexSource );
    			GL.CompileShader( vertexShader );
    			
    			
    			fragmentShader = GL.CreateShader( ShaderType.FragmentShader );
    			GL.ShaderSource( fragmentShader, fragmentSource );
    			GL.CompileShader( fragmentShader );
    			
    			
    			shaderProgram = GL.CreateProgram();
    			GL.AttachShader( shaderProgram, vertexShader );
    			GL.AttachShader( shaderProgram, fragmentShader );
    			
    			GL.LinkProgram(shaderProgram);
    			
    			
    			MVPID = GL.GetUniformLocation(shaderProgram, "MVP");
    			PositionID = GL.GetAttribLocation(shaderProgram, "Position");
    		
    			MVP = Matrix4.CreateOrthographicOffCenter(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 2.0f);
    		}
    
    		/// <summary>
    		/// Called when your window is resized. Set your viewport here. It is also
    		/// a good place to set up your projection matrix (which probably changes
    		/// along when the aspect ratio of your window).
    		/// </summary>
    		/// <param name="e">Not used.</param>
    		protected override void OnResize (EventArgs e)
    		{
    			base.OnResize (e);
    
    			GL.Viewport (ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
    
    		}
    
    		/// <summary>
    		/// Called when it is time to setup the next frame. Add you game logic here.
    		/// </summary>
    		/// <param name="e">Contains timing information for framerate independent logic.</param>
    		protected override void OnUpdateFrame (FrameEventArgs e)
    		{
    			base.OnUpdateFrame (e);
    
    			if (Keyboard [Key.Escape])
    				Exit ();
    		}
    
    		/// <summary>
    		/// Called when it is time to render the next frame. Add your rendering code here.
    		/// </summary>
    		/// <param name="e">Contains timing information.</param>
    		protected override void OnRenderFrame (FrameEventArgs e)
    		{
    			base.OnRenderFrame (e);
    
    			GL.Clear (ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
    
    			GL.UseProgram (shaderProgram);
    			
    			GL.UniformMatrix4(MVPID, false, ref MVP);
    			
    			GL.EnableVertexAttribArray(PositionID);
        		GL.BindBuffer(BufferTarget.ArrayBuffer, vbo);
        		GL.VertexAttribPointer(PositionID, 3, VertexAttribPointerType.Float, false, 0, IntPtr.Zero);
    			
    			GL.DrawArrays(BeginMode.Triangles, 0, 3);
    			
    			GL.DisableVertexAttribArray(PositionID);
    			GL.UseProgram (0);
    
    			SwapBuffers ();
    		}
    
    		/// <summary>
    		/// The main entry point for the application.
    		/// </summary>
    		[STAThread]
    		static void Main ()
    		{
    			// The 'using' idiom guarantees proper resource cleanup.
    			// We request 30 UpdateFrame events per second, and unlimited
    			// RenderFrame events (as fast as the computer can handle).
    			using (Game game = new Game()) {
    				game.Run (30.0);
    			}
    		}
    	}
    }
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Dumb Dumb x 1 (list)

  10. Post #2610
    Tamschi's Avatar
    December 2009
    3,169 Posts
    Apparently it's possible to use the projection matrix for this. I'll try it and post the code if it works.

    Edited:

    ...or not. My computer just broke.
    I tried to use this: http://www.terathon.com/code/oblique.html

    It doesn't work though, for some reason. I think I'll try using a second depth buffer, if I continue working on the mirror, mostly for the arbitrary surface that should be possible that way.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Informative Informative x 1 (list)

  11. Post #2611
    lawlavex's Avatar
    July 2012
    143 Posts
    I'd like some help on making a timer of some sort using Processing, if anyone knows what that is.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #2612
    ECrownofFire's Avatar
    January 2011
    1,993 Posts
    I'd like some help on making a timer of some sort using Processing, if anyone knows what that is.
    Is this what you mean?

    http://processing.org/reference/second_.html
    Reply With Quote Edit / Delete Windows XP United States Show Events

  13. Post #2613
    Gold Member
    Neo Kabuto's Avatar
    November 2008
    5,641 Posts
    http://processing.org/reference/millis_.html might be more useful. millis() returns the number of ms since the applet started, but second() returns the seconds count for the current minute.
    Reply With Quote Edit / Delete Mac United States Show Events

  14. Post #2614
    Gold Member
    BackwardSpy's Avatar
    May 2008
    6,415 Posts
    I have a number that I need to select a random '1' bit from as quickly as possible.
    The naive solution of course is to iterate over each bit, add the '1' bits to an array or something and then pick a random one from there.
    But that is cumbersome and slow, and I'd like a better solution. I tried something like this:
    int pickRandomBit(int n, int numBits)
    {
     int bitPos = rand() % numBits;
     unsigned int mask = ~((1 << bitPos) - 1);
    
     if(mask & n) n &= mask;
    
     return n - (n & (n - 1));
    }
    But this heavily favours the lower significance bits. I need something that has a much more even probability of selecting each bit.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Informative Informative x 1 (list)

  15. Post #2615
    Gold Member
    ThePuska's Avatar
    October 2005
    3,417 Posts
    I have a number that I need to select a random '1' bit from as quickly as possible.
    The naive solution of course is to iterate over each bit, add the '1' bits to an array or something and then pick a random one from there.
    But that is cumbersome and slow, and I'd like a better solution. I tried something like this:
    int pickRandomBit(int n, int numBits)
    {
     int bitPos = rand() % numBits;
     unsigned int mask = ~((1 << bitPos) - 1);
    
     if(mask & n) n &= mask;
    
     return n - (n & (n - 1));
    }
    But this heavily favours the lower significance bits. I need something that has a much more even probability of selecting each bit.
    If the bits are evenly spaced on average, this gives an even probability on average.

    int pickRandomBit(unsigned int n, unsigned int numBits, unsigned int rnd)
    {
    	int c;
    	unsigned int bp = rnd % numBits;
    	unsigned int mask = (1 << bp);
    	unsigned int bit = 0;
    	if (n == 0) return 0;
    	/* Loop through the bits in a for-loop to make sure the compiler
    	 * unrolls it. We're breaking out of it anyway. */
    	for (c = 0; c < 8 * sizeof(unsigned int); c++)
    	{
    		bit = mask & n;
    		/* If the current bit is not set, left rotate the mask bit. */
    		if (bit == 0)
    			mask = (mask << 1) | (mask >> (numBits - 1));
    		else break;
    	}
    	return bit;
    }

    The naive solution is the best solution if you require absolute equality. Though I wouldn't store the bits; iterate through them once to count how many bits are set, pick a random number between 0 and the amount of set bits, and iterate again to find the random bit.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  16. Post #2616
    lawlavex's Avatar
    July 2012
    143 Posts
    I wanted to know if there was a way to make a timer that starts when a button is pressed, and a way to reset it when a different button is pressed.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 1 (list)

  17. Post #2617
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    Can someone please answer this? I really try not to be spammy, but this is the third time I've asked and I've gotten no responses.
    Alright, have you already built and placed GLFW in the correct folder (include and lib directories)?
    What do you mean by built?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #2618
    Richy19's Avatar
    May 2010
    5,375 Posts
    Can someone please answer this? I really try not to be spammy, but this is the third time I've asked and I've gotten no responses.

    What do you mean by built?
    Not trying to be rude but you really shouldnt be using C/C++ if you dont even know what this is.
    One google search http://www.glfw.org/release-2.7.4.html#compiling
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Agree Agree x 1 (list)

  19. Post #2619
    Gold Member
    BackwardSpy's Avatar
    May 2008
    6,415 Posts
    If the bits are evenly spaced on average, this gives an even probability on average.

    int pickRandomBit(unsigned int n, unsigned int numBits, unsigned int rnd)
    {
    	int c;
    	unsigned int bp = rnd % numBits;
    	unsigned int mask = (1 << bp);
    	unsigned int bit = 0;
    	if (n == 0) return 0;
    	/* Loop through the bits in a for-loop to make sure the compiler
    	 * unrolls it. We're breaking out of it anyway. */
    	for (c = 0; c < 8 * sizeof(unsigned int); c++)
    	{
    		bit = mask & n;
    		/* If the current bit is not set, left rotate the mask bit. */
    		if (bit == 0)
    			mask = (mask << 1) | (mask >> (numBits - 1));
    		else break;
    	}
    	return bit;
    }

    The naive solution is the best solution if you require absolute equality. Though I wouldn't store the bits; iterate through them once to count how many bits are set, pick a random number between 0 and the amount of set bits, and iterate again to find the random bit.
    Thank you for a brilliant answer.
    The bits in question are in a bitfield, and the values are more likely to be right next to each other that spaced out evenly.
    As for what you said about not storing the results, I didn't think of doing it how you said.

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

  20. Post #2620
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    Not trying to be rude but you really shouldnt be using C/C++ if you dont even know what this is.
    One google search http://www.glfw.org/release-2.7.4.html#compiling
    I tried that already. It just says "'make' is not recognized as an internal or external command, operable program, or batch file."
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  21. Post #2621
    calzoneman's Avatar
    February 2008
    460 Posts
    I tried that already. It just says "'make' is not recognized as an internal or external command, operable program, or batch file."
    Make is a Unix utility. If you expect to be able to use it on Windows you have to install some form of Unix-Windows port like cygwin or msys.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  22. Post #2622
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    You don't need be discouraging. The reason I asked is because I wanted to learn. How do you think one learns? By seeing a problem that he can't solve, and finding the solution.


    automerge
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  23. Post #2623
    calzoneman's Avatar
    February 2008
    460 Posts
    You don't need be discouraging. The reason I asked is because I wanted to learn. How do you think one learns? By seeing a problem that he can't solve, and finding the solution.


    automerge
    Google is an excellent tool for simple errors such as the one you posted. A general rule of internet etiquette is to search for existing solutions to the problem, and if you don't find any then make a post.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  24. Post #2624
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    Google is an excellent tool for simple errors such as the one you posted. A general rule of internet etiquette is to search for existing solutions to the problem, and if you don't find any then make a post.
    I didn't find it; that's why I made the post
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  25. Post #2625
    Gold Member
    Neo Kabuto's Avatar
    November 2008
    5,641 Posts
    I wanted to know if there was a way to make a timer that starts when a button is pressed, and a way to reset it when a different button is pressed.
    I'd just use millis to get the start time, then use it again to compare the current time to it. The reset button would just move the start time to the current time again.
    Reply With Quote Edit / Delete Mac United States Show Events

  26. Post #2626

    January 2012
    414 Posts
    I didn't find it; that's why I made the post
    Comes with mingw, its called mingw32-make.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Agree Agree x 2 (list)

  27. Post #2627
    lawlavex's Avatar
    July 2012
    143 Posts
    I'd just use millis to get the start time, then use it again to compare the current time to it. The reset button would just move the start time to the current time again.
    Thanks, I ended up finding a nice object oriented timer that also used millis(). Another quick question, is Processing capable of doing things such as shutting down a computer?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  28. Post #2628
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    9,808 Posts
    Another quick question, is Processing capable of doing things such as shutting down a computer?
    Well, this is a tricky question. Simple answer: yes, Processing is capable of doing anything. Processing is really just a library for Java. Java can do technically do anything. But there is no nice, built-in, cross-platform way to shut down a computer with Java. You can either invoke the system executable responsible for shutting down (shutdown.exe on Windows, shutdown on Linux), or you can use trickier things like JNI to call the API function responsible for shutting down. But JNI would be really awkward to get working in a Processing environment (possible, but awkward).

    You could use something like this (taken from this StackOverflow post):
    public static void shutdown() throws RuntimeException, IOException {
    String shutdownCommand;
    String operatingSystem = System.getProperty("os.name");

    if ("Linux".equals(operatingSystem) || "Mac OS X".equals(operatingSystem)) {
    shutdownCommand = "shutdown -h now";
    }
    else if ("Windows".equals(operatingSystem)) {
    shutdownCommand = "shutdown.exe -s -t 0";
    }
    else {
    throw new RuntimeException("Unsupported operating system.");
    }

    Runtime.getRuntime().exec(shutdownCommand);
    System.exit(0);
    }
    But I'm not sure whether that code works directly in Processing or whether you have to explicitly import some libraries.
    Reply With Quote Edit / Delete Windows 8 Canada Show Events Useful Useful x 1 (list)

  29. Post #2629
    ECrownofFire's Avatar
    January 2011
    1,993 Posts
    I didn't find it; that's why I made the post
    Alright, here's a step by step.

    You SHOULD already have mingw-get in your MinGW installation's bin folder. If you don't, this won't work.

    1. Open up CMD prompt.
    2. Enter this without quotes: "mingw-get update" (Might as well update the lists while you're doing this)
    3. Enter this without quotes: "mingw-get install msys"
    4. Wait for it to download and install, then close the CMD prompt.
    5. Go to your mingw installation directory, there should be a folder called "msys" in it. Inside of that is a folder with a version number (1.0 currently), and inside of THAT is "msys.bat". Open that up, and now you have a Unix-ish shell.

    There you go. Just CD over to your directory and "make" should do everything you need. After it finishes, you can "make install prefix=(mingw directory)" and it should get copied over. (Obviously, replace that (mingw directory) with your actual mingw directory location, excluding the parentheses.)
    Reply With Quote Edit / Delete Windows XP United States Show Events

  30. Post #2630
    Gold Member
    Asgard's Avatar
    July 2010
    3,601 Posts
    I'm following a 4 year Game Development course in the Netherlands where we get the freedom of choosing our own programming language. I've been going on and off with C++ and multiple libraries through this year. And while most programs developed were made in AS3, I've decided to continue with a language I personally find more useful in the industry. I've been contemplating C++ as my language of choice, however I was told that this was something that has never been done by anyone on the course before. Most of the students settle for AS3, seeing as that is the language that we have been taught in the first year, or C#. Do you think it is feasible for me to use C++ for my assignments, given that I have a limited timeframe for assignments, or should I try a more universally used language in this course seeing as that might be faster and wouldn't cause any problems when working in group projects.

    I have to add that I favor C++ over any language. It's become a language that I'm very comfortable with, and I have a tough time getting into different programming languages.

    I hope my post was at least a bit comprehensible. If it isn't, I will revise it later.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  31. Post #2631
    calzoneman's Avatar
    February 2008
    460 Posts
    I'm following a 4 year Game Development course in the Netherlands where we get the freedom of choosing our own programming language. I've been going on and off with C++ and multiple libraries through this year. And while most programs developed were made in AS3, I've decided to continue with a language I personally find more useful in the industry. I've been contemplating C++ as my language of choice, however I was told that this was something that has never been done by anyone on the course before. Most of the students settle for AS3, seeing as that is the language that we have been taught in the first year, or C#. Do you think it is feasible for me to use C++ for my assignments, given that I have a limited timeframe for assignments, or should I try a more universally used language in this course seeing as that might be faster and wouldn't cause any problems when working in group projects.

    I have to add that I favor C++ over any language. It's become a language that I'm very comfortable with, and I have a tough time getting into different programming languages.

    I hope my post was at least a bit comprehensible. If it isn't, I will revise it later.
    If you're just trying to get the assignments done, choose a language you're comfortable with using that won't cause you headaches trying to figure out how something should be done. That being said, if you're trying to get useful experience out of the class I would go with C++ or C# since Flash seems to be on its way out (good riddance).
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #2632
    Gold Member
    esalaka's Avatar
    July 2007
    10,119 Posts
    If you can use C++ and you know you're able to do it, why not.

    Otherwise use something else.

    Edited:

    And yeah, Flash is pretty much officially soon-to-be history since Adobe stopped supporting it on mobile devices, which seems to suggest they don't really want people to start using it more.
    Reply With Quote Edit / Delete Linux Finland Show Events Agree Agree x 3 (list)

  33. Post #2633

    January 2012
    132 Posts
    I didn't find it; that's why I made the post
    Make sure you have MinGW\bin folder in your PATH variable
    Reply With Quote Edit / Delete Windows XP Russian Federation Show Events

  34. Post #2634
    Clops with bisousbisous daily <3
    Mr. Smartass's Avatar
    December 2010
    9,188 Posts
    What's the best way to do platforming collision detection? I'm currently placing rectangles around my object and then checking the up/down/left/right collisions with them, but this is a piece of shit when the character is moving more than one pixel per frame.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #2635
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,457 Posts
    Where do I place a file to be read by openFileInput on Android? I tried making a folder at the root of the package called maps, and tried to access the map.txt file using openFileInput("maps/map.txt) but it doesn't work.

    I realized that I can only open a file, not a file path using openFileInput. I have changed it and put the file map.txt into a folder named files in the root of the project. However, it still doesn't work.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  36. Post #2636
    BMCHa's Avatar
    August 2007
    851 Posts
    Adobe stopped supporting it on mobile devices, which seems to suggest they don't really want people to start using it more.
    While they've stopped supporting it on mobile browsers, they still do update and encourage use of AIR on mobile platforms.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2 (list)

  37. Post #2637
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,677 Posts
    What's the best way to do platforming collision detection? I'm currently placing rectangles around my object and then checking the up/down/left/right collisions with them, but this is a piece of shit when the character is moving more than one pixel per frame.
    Use aabb penetration solving instead, it's much more exact and clean. You would still have to do some nice time stepping or some simple tracers to keep fast moving objects from flying through everything though.
    Reply With Quote Edit / Delete Linux United States Show Events

  38. Post #2638
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Where do I place a file to be read by openFileInput on Android? I tried making a folder at the root of the package called maps, and tried to access the map.txt file using openFileInput("maps/map.txt) but it doesn't work.

    I realized that I can only open a file, not a file path using openFileInput. I have changed it and put the file map.txt into a folder named files in the root of the project. However, it still doesn't work.
    openFileInput opens files stored in the private Application specific storage on the phone, it's not related to the files in your project at all. If you want to include a file with your project and read it later, put it in the raw resource directory and use:

    InputStream in = getResources().openRawResource(R.raw.filename);
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  39. Post #2639
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,457 Posts
    How can I open a resource by using it's name?

    NVM Figured it out http://www.anddev.org/tinytut_-_get_...ier_-t460.html
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  40. Post #2640
    Gold Member
    esalaka's Avatar
    July 2007
    10,119 Posts
    While they've stopped supporting it on mobile browsers, they still do update and encourage use of AIR on mobile platforms.
    Ah, dangit. I always consider Flash a purely web technology. Thanks for reminding.
    Reply With Quote Edit / Delete Linux Finland Show Events Friendly Friendly x 1 (list)