• What are you working on? May 2012
    2,222 replies, posted
You should release it to google play like now :v:
[QUOTE=Mordi;35862882]Well, I'll let this video do most of the explaining. As you can see, my in-game cursor is way off of the actual position of the cursor. -vid- Also, check out that textbox with text that breaks. I spent several hours yesterday and today scratching my head over how to make it properly break the lines... It's probably horribly unoptimized: [cpp]void Font::DrawFormatted(int x, int y, std::string str, int width, int lineHeight) { int pos = 0, posPrev = 0; while(GetWidth(str.substr(posPrev, str.length() - posPrev)) > width) { while(GetWidth(str.substr(posPrev, pos - posPrev)) < width) // find the first line { pos ++; } if (str.substr(posPrev, pos - posPrev).find_first_of(" ", 0) != string::npos) // if the line contains a space { while(str.substr(pos - 1, 1) != " ") { pos --; } } else // insert a dash at the end of the line { pos--; str.insert(pos - 1, "-"); } Draw(x, y, str.substr(posPrev, pos - posPrev), 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); y += lineHeight; posPrev = pos; } // Draw the last line Draw(x, y, str.substr(pos, str.length() - pos), 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); }[/cpp][/QUOTE] I don't understand how that's a problem of not having the absolute position. Wouldn't you draw the cursor at the relative position? I can't think of a reason to need absolute position for cursor rendering that isn't an obscene hack.
[QUOTE=Map in a box;35863213]You should release it to google play like now :v:[/QUOTE] Sorry, I'm waiting for a simultaneous release :)
But why? I demand you to release it on the platforms its ready for :saddowns:
[vid]http://dl.dropbox.com/u/11197643/shadowmapping.webm[/vid] Messing with my shadow mapping, added some moving lights.
the ios release could take another month for all you know
[QUOTE=dije;35862935] No, I'm talking about the actual code implementation[/QUOTE] Here: [url]http://pastebin.com/1ribKmw2[/url] (TEMPORATYSCALE is a temporary variable I added for testing, just assume it's always 1)
[QUOTE=Mordi;35862882]Well, I'll let this video do most of the explaining. As you can see, my in-game cursor is way off of the actual position of the cursor.[/QUOTE] um, pretty sure that's your implementation and not GLFW: [code]#include <iostream> #include "GL/glfw.h" int windowWidth = 800; int windowHeight = 600; int mouseX; int mouseY; void windowsettings(){ glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 0); //full screen antialiasing glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE, GL_FALSE); // false = resizable window //glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); //version 3 of openGL //glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); //version 3.2 of openGL } void GLFWCALL onWindowResize(int width, int height){ windowWidth = width; windowHeight = height; // Define the portion of the window used for OpenGL rendering. glViewport( 0, 0, width, height ); // View port uses whole window glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho( 0, width, 0, height, -1, 1 ); } void GLFWCALL onMouseClick(int button, int state){ if(state == GLFW_PRESS){std::cout << "Mouse: {" << mouseX << ", " << mouseY << "}\n";} } int main(int argc, char** argv){ mouseX = 0; mouseY = 0; if(!glfwInit()){ exit(EXIT_FAILURE); } // Open an OpenGL window if(glfwOpenWindow(windowWidth, windowHeight, 0, 0, 0, 0, 16, 0, GLFW_WINDOW)){ glfwSetWindowTitle("Beep boop it's a title"); glfwSetWindowSizeCallback(onWindowResize); glfwSetMouseButtonCallback( onMouseClick ); } else{ //oh fuck we failed glfwTerminate(); exit( EXIT_FAILURE ); } onWindowResize(windowWidth, windowHeight); //set up viewports and shit //set up GL stuff!?!? glEnable ( GL_DEPTH_TEST ); glPointSize(8); glLineWidth(5); while(glfwGetWindowParam(GLFW_OPENED)) { if(glfwGetWindowParam(GLFW_ACTIVE)){ //do we have focus? glfwGetMousePos( &mouseX, &mouseY); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Set drawing color to white glColor3f( 1.0, 1.0, 1.0 ); glBegin( GL_LINES ); glVertex2f( mouseX, windowHeight - mouseY); glVertex2f( mouseX + 10, windowHeight - mouseY + 10); glEnd(); glfwSwapBuffers(); // Swap front and back rendering buffers }else{ //we don't have focus, so we sleep glfwSleep(.5); glfwPollEvents(); //tell OS that we are alive! } } glfwTerminate(); // Close window and terminate GLFW exit(EXIT_SUCCESS); // Exit program }[/code] this works flawlessly
[QUOTE=HeroicPillow;35863459]um, pretty sure that's your implementation and not GLFW: this works flawlessly[/QUOTE] He has the mouse hidden tho, I think
[QUOTE=Richy19;35863512]He has the mouse hidden tho, I think[/QUOTE] it's visible in the video, and he specifically wanted it without locking the mouse: [QUOTE=Mordi;35858933]To determine mouse-position in windowed mode without locking the mouse.[/QUOTE]
[QUOTE=HeroicPillow;35863549]it's visible in the video, and he specifically wanted it without locking the mouse:[/QUOTE] Well in that case if the mouse is visible and what he wants is the mouse position relative to the window, then GLFW gives the correct values
[t]http://new.tinygrab.com/7cfbd51783c83fcaae89b8947bf6d02469774d45de.png[/t] JFrame :dance: :dance:
[QUOTE=Mordi;35862882]Well, I'll let this video do most of the explaining. As you can see, my in-game cursor is way off of the actual position of the cursor. *video* Also, check out that textbox with text that breaks. I spent several hours yesterday and today scratching my head over how to make it properly break the lines... It's probably horribly unoptimized: [cpp]void Font::DrawFormatted(int x, int y, std::string str, int width, int lineHeight) { int pos = 0, posPrev = 0; while(GetWidth(str.substr(posPrev, str.length() - posPrev)) > width) { while(GetWidth(str.substr(posPrev, pos - posPrev)) < width) // find the first line { pos ++; } if (str.substr(posPrev, pos - posPrev).find_first_of(" ", 0) != string::npos) // if the line contains a space { while(str.substr(pos - 1, 1) != " ") { pos --; } } else // insert a dash at the end of the line { pos--; str.insert(pos - 1, "-"); } Draw(x, y, str.substr(posPrev, pos - posPrev), 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); y += lineHeight; posPrev = pos; } // Draw the last line Draw(x, y, str.substr(pos, str.length() - pos), 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); }[/cpp][/QUOTE] Couldn't you, at game initialization, save the cursor's position somewhere and then set the cursor's position to the window's top left corner, for example, and afterwards change a variable when you move the cursor? Not sure if this would work with GLFW, since I've got no experience with that but perhaps it's an idea?
I've started to realise you can't really make good, fitting icons for actions like "simplify" and "differentiate", so I think I'll just not have icons. I hope it looks good anyway.
[QUOTE=calzoneman;35863232] I can't think of a reason to need absolute position for cursor rendering that isn't an obscene hack.[/QUOTE] Let's say you were running windowed mode in a small window. There is a button on the screen, in the window. With GLFW, you'd have to have your mouse way up to the left of screen to click the button. If you then click your mouse it'll just unfocus your window. The same problem happens if you'd use a locked mouse-position method, where you'd just have the cursor be applied the relative movement of the mouse. Where would one lock the mouse to in order to prevent the mouse from being outside of the window (which would lead to the window becoming unfocused as the user clicks)? I don't know any other way to explain this. Maybe someone else who understands could clarify for calzoneman?
[QUOTE=Overv;35863667]I've started to realise you can't really make good, fitting icons for actions like "simplify" and "differentiate", so I think I'll just not have icons. I hope it looks good anyway.[/QUOTE] Shitty 10s google draw job: [IMG]http://i.imgur.com/FeEjE.png[/IMG]
Why are the ds aligned it looks imbalanced somehow put the upper d in the middle please
[QUOTE=Map in a box;35863335]the ios release could take another month for all you know[/QUOTE] No it won't. It should be ready in a week. I'm doing a simultaneous release to avoid any bubbles. I don't need to be telling people "coming out soon on iOS" while I'm doing support for people on PlayBook and Android.
[QUOTE=HeroicPillow;35863459]um, pretty sure that's your implementation and not GLFW: [code]kowd[/code] this works flawlessly[/QUOTE] Doh! I was using [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390(v=vs.85).aspx]GetCursorPos[/url] instead of GLFW's function. *slaps forehead* Thanks, anyway. Now GLFW seems perfect for my use!
[QUOTE=Map in a box;35863335]the ios release could take another month for all you know[/QUOTE] [QUOTE=icantread49;35863775]No it won't. It should be ready in a week. I'm doing a simultaneous release to avoid any bubbles. I don't need to be telling people "coming out soon on iOS" while I'm doing support for people on PlayBook and Android.[/QUOTE] I agree with this; as long as you haven't breached any of their review guidelines (which shouldn't happen if you've read them unless you have some IAP dispute like Hexxeh had with the FP App) then the process is usually pretty fast. Out of the three Apps and few updates that I've submitted the longest I've had to wait is 6 days.
[media]http://www.youtube.com/watch?v=hkNdr2yx4LY[/media]
bitte um Erklärung
[QUOTE=Kamshak;35864321]bitte um Erklärung[/QUOTE] [media]http://www.youtube.com/watch?v=RSf9aEETnvE[/media]
[QUOTE=swift and shift;35861336]right on! [img]http://i.imgur.com/oiRZo.png[/img] [editline]7th May 2012[/editline] remember folks, everything you see on that screen was done with javascript! [editline]hi[/editline] Here is the source to all the userland utilities if anyone'd like to take a look: [url]https://github.com/charliesome/jsos/tree/master/kernel/js/bin[/url] If you know JavaScript or CoffeeScript, you should write a program for JSOS![/QUOTE] Do you have any guide / instructions on how to build a run it?
[QUOTE=Xeon06;35865014]Do you have any guide / instructions on how to build a run it?[/QUOTE] git clone the code, and run make?
[media]http://www.youtube.com/watch?v=JuFSWwcBzDo[/media] Messing around with Unity (please attempt to ignore hideous programmer art), at least the meteors seem to be working!
[url]http://code.google.com/p/opencl-renderer/[/url] OpenCL renderer source now available (mercurial). If other people want to contribute feel free, though I'll have to add you to the list of allowed people You can download the obj i've been using here: [url]http://dl.dropbox.com/u/33076954/square.obj[/url] The texture it uses is included in the repository (aaaarg.png) The object loader is, unfortunately, terrible. Runs in multiple passes when it could, very easily, run in one pass. I'm going to rewrite that after I get tessellation implemented, but for the moment it works Lighting has been fixed as well so that it is actually (I hope) correct now. Specular lighting is disabled at the moment (it looks crap with the way the lights are positioned currently, also because of no light occlusion through faces) but easily changeable by commenting out spec_light=0 under cl.cl
:ohdear: snip
Please don't use gayzo, they 404 very often. Try using ZScreen or Puush for nice screen capturing tools, although I prefer ZScreen, because it's targeting thing is way better than puush's, but puush is a lot faster.
[QUOTE=.py;35866346]:ohdear: snip[/QUOTE] Don't worry, we don't hate you
Sorry, you need to Log In to post a reply to this thread.