• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=Richy19;31784148] Also has the IRC been closed?[/QUOTE] If you're referring to #fpcoders at irc.gamesurge.net, it's still there. Not very active, though. (not sure what you mean by "closed" in the context of IRC)
[QUOTE=Richy19;31784148]Does anyone know of any secure ways to use steam chat on linux that arent wine? Vapor isnt logging me in and I dont know how else I can chat with FPprogrammers. Also has the IRC been closed?[/QUOTE] The way I got Vapor to work is by using the latest pre-compiled client with a self-compiled SteamRE library.
Just in case anyone is interested in the solution of my strange "culling" problem. Here is the solution. [URL]http://stackoverflow.com/questions/7085473/are-spritebatch-drawcalls-culled-by-xna[/URL] (Don't rate me dumb please, I've no experience with 3d) [QUOTE]I'm trying to get the hwnd of a window to check the title, but all I have is the processID / handle, and I can't seem to make sense of EnumWindows() and callbacks to compare the process IDs of the windows on the desktop to the process ID of the game I'm reading values out of. Help?[/QUOTE] @Lapsus: I am assuming you are working in C/++ First look at this: [URL]http://msdn.microsoft.com/en-us/library/ms633497(v=vs.85).aspx[/URL] The callback is really simple. It works like this: The callback gets called for every window the "enumwindows" function finds. You have to write the callback function yourself, but it's really simple. Its just a function in the format of: [B]WNDENUMPROC [/B] If you look at the definition it becomes clear that thats only a function in the following format: bool CALLBACK MyEnumCallbackFunctionThing(HWND SomeHWND, LPARAM lParam) { // do with the provided stuff whatever you like // return true to continue enumerating // return false to skip the remaining windows... // lparam contains what you provided to the enumwindows function } I hope thats clear now. If not please ask. I' glad if I can help. Edit: @Bambo.: Reinstall visual studio and/or xna. If that doesnt help the crash, I would strongly advise to do a memory test (memtest86+). Because the cause for [I]random [/I]crashes mostly faulty RAM.
[url]http://stackoverflow.com/questions/7099740/ios-taking-a-screenshot-of-tableview[/url] if anyone knows the answer
Im trying to build a SFML window program in Linux(fedora 15) but when i try to build it, it asks me to link to x11, threading library... and stuff that should be in SFML Not that this only happens when using SFML statically
-Snip- Incredibly stupid question, forgot to assign something in my code :P Anyway, what would be the best way to time in xna, I dont need incredibly accurate timing. Guess Ill try StopWatch for now.
I installed linux, and now I cant use GLSL 1.30. Are there any libraries or anything that might give me back 1.30? If not how can I turn my GLSL 1.30 to 1.20, at the moment im only using in/out
Is there a default minimum resolution for XNA applications? I tried using prefferedbackbufferheight/width to set it to a lower resolution, but it wont let me go smaller than the default resolution, only bigger.
[QUOTE=reevezy67;31796089]Is there a default minimum resolution for XNA applications? I tried using prefferedbackbufferheight/width to set it to a lower resolution, but it wont let me go smaller than the default resolution, only bigger.[/QUOTE] did you do GraphicsDeviceManager.ApplyChanges() ?
[QUOTE=Richy19;31796112]did you do GraphicsDeviceManager.ApplyChanges() ?[/QUOTE] Completely forgot about that. Thanks easy fix.
I'm trying to learn C# and when I compile my code (using SharpDev) it just goes to the console then quits shortly after, not allowing me to view the output. This wouldn't be a problem if I was just using the console to do this, cause then it wouldn't exit (I think), but I'm using an environment (if that's what they're called), so it exits. Is there any code I can add to stop it from exiting immediately after the output?
console.read()
[QUOTE=Richy19;31797163]console.read()[/QUOTE] Ah, thank you.
What folder does C# XNA get content files from by default, and how can I change it?
[QUOTE=Richy19;31795956]I installed linux, and now I cant use GLSL 1.30. Are there any libraries or anything that might give me back 1.30? If not how can I turn my GLSL 1.30 to 1.20, at the moment im only using in/out[/QUOTE] Your shaders begin with "#version 130", right? What distro are you using, and are you sure that it's linking to the Nvidia/ATi driver and not Mesa
[QUOTE=masonrulz;31797281]What folder does C# XNA get content files from by default, and how can I change it?[/QUOTE] It defaults to the location of the last thing you imported. If thats what you meant, unless you mean existing content thats already been added which is under the projects folder in (projectname)content.
In SFML.Net 2.0, is there a way to clip or render only part of a Image or Sprite? I want to do animation using sprite sheets.
[QUOTE=Fox-Face;31801475]In SFML.Net 2.0, is there a way to clip or render only part of a Image or Sprite? I want to do animation using sprite sheets.[/QUOTE] [url=http://www.sfml-dev.org/documentation/2.0/classsf_1_1Sprite.php#aae8e8be077534c0b8704e59b0ea4cf9a]Look into sf::Sprite::SetSubRect()[/url]
[QUOTE=ROBO_DONUT;31797828]Your shaders begin with "#version 130", right? What distro are you using, and are you sure that it's linking to the Nvidia/ATi driver and not Mesa[/QUOTE] Yea, 130. How would I know what its linking with? (I have intel btw)
[QUOTE=Richy19;31801776]Yea, 130. How would I know what its linking with? (I have intel btw)[/QUOTE] Intel? Do Intel cards have support for OpenGL 3? You can see what it's linking to by doing an "ls -l /usr/lib/libGL.so" in the command prompt. You want your video card's library linked, not mesa. If it's mesa, delete the symlink and link it to the proper library (it's /usr/lib/nvidia-current/libGL.so for Nvidia, no idea what it is for Intel)
[QUOTE=ROBO_DONUT;31801875]Intel? Do Intel cards have support for OpenGL 3? You can see what it's linking to by doing an "ls -l /usr/lib/libGL.so" in the command prompt. You want your video card's library linked, not mesa. If it's mesa, delete the symlink and link it to the proper library (it's /usr/lib/nvidia-current/libGL.so for Nvidia, no idea what it is for Intel)[/QUOTE] Well my intel car only supported 2.1 but for some reason it supports glsl 130 [editline]18th August 2011[/editline] It gave me this lrwxrwxrwx. 1 root root 10 Aug 17 15:32 /usr/lib/libGL.so -> libGL.so.1
[QUOTE=Richy19;31802135]Well my intel car only supported 2.1 but for some reason it supports glsl 130[/QUOTE] My card only supports OpenGL 3.3, but it supports GLSL 4.2.
Mehh Il just stick with 120, Im havig some trouble with it tho: [cpp] static const GLfloat g_vertex_buffer_data[] = { -1.0f,-1.0f,-1.0f, // triangle 1 : begin -1.0f,-1.0f, 1.0f, -1.0f, 1.0f, 1.0f, // triangle 1 : end 1.0f, 1.0f,-1.0f, // triangle 2 : begin -1.0f,-1.0f,-1.0f, -1.0f, 1.0f,-1.0f, // triangle 2 : end 1.0f,-1.0f, 1.0f, -1.0f,-1.0f,-1.0f, 1.0f,-1.0f,-1.0f, 1.0f, 1.0f,-1.0f, 1.0f,-1.0f,-1.0f, -1.0f,-1.0f,-1.0f, -1.0f,-1.0f,-1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f,-1.0f, 1.0f,-1.0f, 1.0f, -1.0f,-1.0f, 1.0f, -1.0f,-1.0f,-1.0f, -1.0f, 1.0f, 1.0f, -1.0f,-1.0f, 1.0f, 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f,-1.0f, 1.0f, 1.0f,-1.0f, 1.0f,-1.0f,-1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,-1.0f, -1.0f, 1.0f,-1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f,-1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f,-1.0f, 1.0f }; static const GLfloat g_color_buffer_data[] = { 0.583f, 0.771f, 0.014f, 0.609f, 0.115f, 0.436f, 0.327f, 0.483f, 0.844f, 0.822f, 0.569f, 0.201f, 0.435f, 0.602f, 0.223f, 0.310f, 0.747f, 0.185f, 0.597f, 0.770f, 0.761f, 0.559f, 0.436f, 0.730f, 0.359f, 0.583f, 0.152f, 0.483f, 0.596f, 0.789f, 0.559f, 0.861f, 0.639f, 0.195f, 0.548f, 0.859f, 0.014f, 0.184f, 0.576f, 0.771f, 0.328f, 0.970f, 0.406f, 0.615f, 0.116f, 0.676f, 0.977f, 0.133f, 0.971f, 0.572f, 0.833f, 0.140f, 0.616f, 0.489f, 0.997f, 0.513f, 0.064f, 0.945f, 0.719f, 0.592f, 0.543f, 0.021f, 0.978f, 0.279f, 0.317f, 0.505f, 0.167f, 0.620f, 0.077f, 0.347f, 0.857f, 0.137f, 0.055f, 0.953f, 0.042f, 0.714f, 0.505f, 0.345f, 0.783f, 0.290f, 0.734f, 0.722f, 0.645f, 0.174f, 0.302f, 0.455f, 0.848f, 0.225f, 0.587f, 0.040f, 0.517f, 0.713f, 0.338f, 0.053f, 0.959f, 0.120f, 0.393f, 0.621f, 0.362f, 0.673f, 0.211f, 0.457f, 0.820f, 0.883f, 0.371f, 0.982f, 0.099f, 0.879f }; // This will identify our vertex buffer GLuint vertexbuffer; // Generate 1 buffer, put the resulting identifier in vertexbuffer glGenBuffers(1, &vertexbuffer); // The following commands will talk about our 'vertexbuffer' buffer glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); // Give our vertices to OpenGL. glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW); GLuint colorbuffer; glGenBuffers(1, &colorbuffer); glBindBuffer(GL_ARRAY_BUFFER, colorbuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(g_color_buffer_data), g_color_buffer_data, GL_STATIC_DRAW); // Projection matrix : 45° Field of View, 4:3 ratio, display range : 0.1 unit <-> 100 units glm::mat4 Projection = glm::perspective(90.0f, WindowSettings::WindowWidth / WindowSettings::WindowHeight, 0.1f, 100.0f); // Camera matrix glm::mat4 View = glm::lookAt( glm::vec3(4,3,3), // Camera is at (4,3,3), in World Space glm::vec3(0,0,0), // and looks at the origin glm::vec3(0,1,0) // Head is up (set to 0,-1,0 to look upside-down) ); // Model matrix : an identity matrix (model will be at the origin) glm::mat4 Model = glm::mat4(1.0f); // Changes for each model ! // Our ModelViewProjection : multiplication of our 3 matrices glm::mat4 MVP = Projection * View * Model; // Remember, matrix multiplication is the other way around std::string vert = "vert.vert"; std::string frag = "frag.frag"; Shader shader(vert, frag); GLuint MatrixID = glGetUniformLocation(shader.shaderID, "MVP"); glEnable(GL_DEPTH_TEST); // Accept fragment if it closer to the camera than the former one glDepthFunc(GL_LESS); // Start game loop while (App.IsOpened()) { // Process events sf::Event Event; while (App.PollEvent(Event)) { Game::HandleEvents(Event); } Game::Update(); App.SetActive(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Dark blue background glClearColor(0.392156863f, 0.584313725f, 0.929411765f, 0.0f); Game::Draw(); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); glVertexAttribPointer( 0, // attribute 0. No particular reason for 0, but must match the layout in the shader. 3, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride (void*)0 // array buffer offset ); glEnableVertexAttribArray(1); glBindBuffer(GL_ARRAY_BUFFER, colorbuffer); glVertexAttribPointer( 1, // attribute. No particular reason for 1, but must match the layout in the shader. 3, // size GL_FLOAT, // type GL_FALSE, // normalized? 0, // stride (void*)0 // array buffer offset ); glUseProgram(shader.shaderID); // Send our transformation to the currently bound shader, // in the "MVP" uniform // For each model you render, since the MVP will be different (at least the M part) glUniformMatrix4fv(MatrixID, 1, GL_FALSE, &MVP[0][0]); // Draw the triangle ! glDrawArrays(GL_TRIANGLES, 0, 12*3); // Starting from vertex 0; 3 vertices total -> 1 triangle glDisableVertexAttribArray(0); // Display window contents on screen App.Display(); } } [/cpp] vertex [cpp] #version 120 uniform vec4 Position; uniform mat4 MVP; attribute vec3 vertexColor; varying vec3 glColor; void main(){ glColor = vertexColor; gl_Position = MVP * Position; } [/cpp] frag [cpp] #version 120 varying vec3 glColor; void main(){ gl_FragColor = vec4(glColor.x, glColor.y, glColor.z, 1.0f); } [/cpp] It should show a cube like [img]http://www.opengl-tutorial.org/wp-content/uploads/2011/04/one_color_per_vertex-300x231.png[/img] But the screen is just blank
[QUOTE=ROBO_DONUT;31801875]Intel? Do Intel cards have support for OpenGL 3?[/QUOTE] I don't know about their older GPUs, but the Sandy Bridge integrated GPU supports OpenGL 3. Mesa, however, does not. [QUOTE=ROBO_DONUT;31801875]You want your video card's library linked, not mesa. If it's mesa, delete the symlink and link it to the proper library (it's /usr/lib/nvidia-current/libGL.so for Nvidia, no idea what it is for Intel)[/QUOTE] Mesa [i]is[/i] the right libGL for an Intel GPU. It's the right libGL for any system not using the proprietary nVidia or ATi driver. Mesa's libGL interfaces with GPU-specific DRM (direct rendering manager) drivers in the kernel using DRI (the direct rendering interface), so it can use hardware acceleration where available.
[QUOTE=dajoh;31802209]My card only supports OpenGL 3.3, but it supports GLSL 4.2.[/QUOTE] It's sort of similar, but I remember Star Wars: Battlefront 2 complained about something on startup. I could ignore it, but whenever I crashed my spaceship the entire computer would crash. It really hated that one shader.
Any tips on how to make my mobile linux (Fedora on USB drive) OpenGL 3.2 ready? I need to be able to boot if my graphics card isn't Radeon, so catalyst isn't an option, else somebody knows some awesome wizardry of only loading fglrx when it's needed.
I'm really new to this, but if I declare a variable in my Main method, how do I use it in another method in the same program class? I get:"The name reel does not exist in this context"
[QUOTE=WeltEnSTurm;31807400]Any tips on how to make my mobile linux (Fedora on USB drive) OpenGL 3.2 ready? I need to be able to boot if my graphics card isn't Radeon, so catalyst isn't an option, else somebody knows some awesome wizardry of only loading fglrx when it's needed.[/QUOTE] The old Sabayon LiveCDs used to ship with proprietary drivers and load them automatically on startup. I'm not sure if they still do. [editline]18th August 2011[/editline] [QUOTE=Fergeh;31808292]I'm really new to this, but if I declare a variable in my Main method, how do I use it in another method in the same program class? I get:"The name reel does not exist in this context"[/QUOTE] Declare it in the class's namespace rather than as a local variable? If you're asking for exact syntax, that's language-specific.
Well I've got this credits variable, but if I move it out of the Main method and just into the Program Class, I get "an object reference is needed for this non-static field or class. [csharp] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Bells { class Program { static void Main(string[] args) { int credits = 10; bool done = false; Console.WriteLine("+++++++++++++++++++\n+ Bells +\n+++++++++++++++++++"); while (done != true) { Console.WriteLine("You have {0} credits, which game do you want to play?\n1)1 credit wager\n2)2 credit wager\n3)5 credit wager\n4)10 credit wager", credits); string selection; selection = Console.ReadLine(); switch (selection) { case ("1"): { Play(1); break; } } } } static void Play(int wager) { string[] reel = new string[3]; reel[0] = "Bell"; reel[1] = "Coin"; reel[2] = "Cherry"; Random x = new Random(); int xreel = x.Next(0, 3); int yreel = x.Next(0, 3); int zreel = x.Next(0, 3); int prize; Console.WriteLine("{0}, {1}, {2}", reel[xreel], reel[yreel], reel[zreel]); if(xreel == yreel && xreel == zreel) { Console.WriteLine("You Win!"); credits = credits + 5; } } } } [/csharp] [editline]18th August 2011[/editline] It seems to be working by moving it into the program class and slapping static in front of it, I'm not really sure how that works but nevermind
I'm using SFML 1.6 with C++, and need to get this to work. I get the following error: obj\Debug\onInit.o:C:\Users\Owner\Desktop\SFMLStuff\SFMLTest\entities.h|71|undefined reference to `Bullet::tImage'| But I have no idea what it could mean, since I did define tImage. Everything else compiles fine. [cpp] class Bullet: public Entities{ public: static bool Init(){ return tImage.LoadFromFile("C:/Users/Owner/Desktop/SFMLStuff/2DGameArt/Spaceships2_Skorpio/AssaultboatB.png"); // << LINE 71 } Bullet(){ Sprite.SetImage(tImage); Sprite.SetCenter(Sprite.GetSize().x/2,Sprite.GetSize().y/2); Sprite.SetScale(0.5f,0.5f); posX = 0; posY = 0; angle = 0; dirNorm = sf::Vector2f(1.f,0); movVec = sf::Vector2f(0,0); } void setTarget(sf::Vector2f target){this->target = target;} sf::Vector2f getTarget(){return target;} private: sf::Vector2f target; static sf::Image tImage; }; [/cpp]
Sorry, you need to Log In to post a reply to this thread.