[QUOTE=Goz3rr;41550128]I don't think you implemented IDisposable properly: [url]http://msdn.microsoft.com/en-us/library/ms244737(v=vs.80).aspx[/url][/QUOTE]
tbh i'm not sure i should even be using IDisposable.
[QUOTE=twoski;41558660]tbh i'm not sure i should even be using IDisposable.[/QUOTE]
Yeah, that's looking like IDisposable abuse to me. You should really only be using it if you've got unmanaged resources stored in a class, like a file stream or something.
And on a side note, make IsDisposed "{ get; private set: }" so that any old idiot can't be like "myEnt.IsDisposed = true;" and get unexpected behavior.
I made some changes to my Entity class and changed it to use reflection. I want this to be the basic class that everything has to derive from.
[url]http://pastebin.com/MJXg9XyY[/url]
I'm confused about how i'm supposed to implement an entity factory. Should it be a static thing or should i have to instantiate it?
[QUOTE=twoski;41559970]I made some changes to my Entity class and changed it to use reflection. I want this to be the basic class that everything has to derive from.
[url]http://pastebin.com/MJXg9XyY[/url]
I'm confused about how i'm supposed to implement an entity factory. Should it be a static thing or should i have to instantiate it?[/QUOTE]
I don't think there'd be need for a factory if it can be static. Afaik they are usually used if the whole entity implementation is decoupled from the part of the program using it.
The built-in serializer isn't fit for long-term storage and sub-par for networking. Look into protocol buffers (protobuf-net) for a much better alternative.
[QUOTE=Tamschi;41560026]I don't think there'd be need for a factory if it can be static. Afaik they are usually used if the whole entity implementation is decoupled from the part of the program using it.
The built-in serializer isn't fit for long-term storage and sub-par for networking. Look into protocol buffers (protobuf-net) for a much better alternative.[/QUOTE]
Well i mean, the whole point of a factory is to just hide the implementation of creating entities and simplify the process, so what would be the real benefit of instantiating the factory?
I'm not planning to do anything networking-wise with my serialization, i just want to be able to store entity data in a file and read it at a later date.
Is there an sql compiler or is Oracle basically the compiler? We are using Oracle in my class, and it's really slow so it's a pain in the ass to test my code.
[QUOTE=twoski;41560142]Well i mean, the whole point of a factory is to just hide the implementation of creating entities and simplify the process, so what would be the real benefit of instantiating the factory?
I'm not planning to do anything networking-wise with my serialization, i just want to be able to store entity data in a file and read it at a later date.[/QUOTE]
In that case a static factory is probably right, but still somewhat differing from what C# usually does.
Using the built-in serialization for persistent storage is not fine though, you're going to lose all your data because it breaks with the smallest, seemingly unrelated changes.
[editline]23rd July 2013[/editline]
[QUOTE=wlitsots;41560178]Is there an sql compiler or is Oracle basically the compiler? We are using Oracle in my class, and it's really slow so it's a pain in the ass to test my code.[/QUOTE]
Welcome to the world of databases :v:
There's not much your can do to avoid SQL, but there may be stored procedures that you can use instead of dynamic ones to speed things up.
[QUOTE=Tamschi;41560361]
Using the built-in serialization for persistent storage is not fine though, you're going to lose all your data because it breaks with the smallest, seemingly unrelated changes.[/QUOTE]
In what scenario would it break? If the built in serialization is incapable of functioning properly then why would anyone use it?
Does ISerializable only work with properties that are primitive data types?
[QUOTE=twoski;41560915]In what scenario would it break? If the built in serialization is incapable of functioning properly then why would anyone use it?
Does ISerializable only work with properties that are primitive data types?[/QUOTE]
It embeds type information, so it breaks as soon as you increment the version number (afaik) or any implementation detail. It can also happen when the framework updates. With protobuf-net you can deserialize as an entirely different class that just matches part of the format, if you need to, and it's standardized and won't break from unrelated changes.
The only reason people use it is that it's built-in and [I]not broken enough to be readily visible[/I]. It's really one of the worst solutions out there.
Uh, I know nothing about programming, but I'd like to make a small program for convenience sake while playing a paper and pencil game.
[img]http://i.imgur.com/KqzOZaV.png[/img]
I need to know what I have to do to make something like this. It just has tabs and stuff for keeping track of your character, and I'd like to make this exactly, but for the Cyberpunk stats and skills, etc.
Can someone point me in the right direction?
A link for said sheet program and an example of the sheets it exports/imports.
[url]https://www.dropbox.com/s/dbnvc56t3opkcjs/FalloutCharacterSheet.zip[/url]
Is there any problem throwing standard C++ exceptions or is it better to subclass? I have a container class that needs to throw an exception indicating programmer error in the event an occupied cell is written to, so I just throw std::logic_error(relevant_message), is this considered poor style?
Bit of a crosspost from the WAYWO, anyway.
I'm working on a function library written in PHP to handle simple web application tasks like data caching and user management, there's not really much to show off but i've got a question.
What's the best approach to take for keeping Memcache records in sync with other data sources such as MySQL and Files? I want to be able to edit something in the database (or in a file) and then have the changes synced to the Memcache server in as little time as possible.
Let's say I load an sRGB image into opengl, and specify it as such. The values that will be passed to the frag shader via texture() will be in lRGB right? But will these values be converted back to sRGB? So let's say I load two textures, one sRGB and one lRGB. If lRGB texture is the sRGB texture without gamma correction, then they would render the same, right?
[QUOTE=WTF Nuke;41563519]Let's say I load an sRGB image into opengl, and specify it as such. The values that will be passed to the frag shader via texture() will be in lRGB right? But will these values be converted back to sRGB? So let's say I load two textures, one sRGB and one lRGB. If lRGB texture is the sRGB texture without gamma correction, then they would render the same, right?[/QUOTE]
They will both stay lRGB unless you call [code]glEnable(GL_FRAMEBUFFER_SRGB);[/code] which enables the conversion to sRGB after blending.
I want to use GWEN in SFML2 project. It's kinda hard, or maybe I'm just complicating things.
Anyway.
Firstly I've fetched GWEN from Garry's GitHub repo. Runned Build.bat, to build project files.
Next launched VS10 solution in VS12 (possible cause of problems?). It asked me to update project to match VS12, everything updated OK.
Compiling (both Debug and Release):
GWEN-DLL, GWEN-Static and Renderer-SFML2 good (I don't need to compile more projects?).
Back in my SFML2 project. Added GWEN's include and lib folder to project properties.
Then added for Debug config:
[CODE]GWEND-Renderer-SFML2d.lib
gwend.lib[/CODE]
and for Release:
[CODE]GWEN-Renderer-SFML2.lib
gwen.lib[/CODE]
Build solution - everything good, SFML window show up etc.
BUT!
After adding this:
[CODE]Gwen::Renderer::SFML2 GwenRenderer(*GameWindow);[/CODE]
this error shows up:
[CODE]error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug'[/CODE]
So I've found in Google that changing from: [I]Multi-threaded Debug DLL (/MDd)[/I] to [I]Multi-threaded Debug (/MTd)[/I]
in Project Properties > C/C++ > Code Generation > Runtime Librarywill help. And indeed it's better, but now:
[CODE]error LNK2019: unresolved external symbol __imp__glScissor@16 referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::StartClip(void)" (?StartClip@SFML2@Renderer@Gwen@@UAEXXZ)
error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::StartClip(void)" (?StartClip@SFML2@Renderer@Gwen@@UAEXXZ)
error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function "public: virtual void __thiscall Gwen::Renderer::SFML2::EndClip(void)" (?EndClip@SFML2@Renderer@Gwen@@UAEXXZ)
error LNK2005: "public: __thiscall sf::String::~String(void)" (??1String@sf@@QAE@XZ) already defined in GWEND-Renderer-SFML2d.lib(SFML2.obj)
error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
error LNK1120: 4 unresolved externals
[/CODE]
Anyone can explain what I'm doing wrong?
The first three should go away when you link against the OpenGL library (I think opengl32 on Windows).
I'm unsure about the latter two. Perhaps you statically linked against SFML2 in the GWEN renderer library?
what does this [code]playBtn:setReferencePoint(display.CenterReferencePoint)[/code] do in Lua(Corona). If you can explain it like you were talking to an idiot
[QUOTE=RandomDexter;41565240]what does this [code]playBtn:setReferencePoint(display.CenterReferencePoint)[/code] do in Lua(Corona). If you can explain it like you were talking to an idiot[/QUOTE]
I haven't messed with Corona for a while, but I'm guessing that it sets the origin of the object (Button?) to it's center so that the position you draw it on the screen corresponds to the center of object.
[QUOTE=ZeekyHBomb;41564906]The first three should go away when you link against the OpenGL library (I think opengl32 on Windows).
I'm unsure about the latter two. Perhaps you statically linked against SFML2 in the GWEN renderer library?[/QUOTE]
First three gone.
And the last two aren't because of static link in GWEN renderer.
EDIT: You were right. I've made a mistake. It's working great now. Thank you!
[QUOTE=Tamschi;41563986]They will both stay lRGB unless you call [code]glEnable(GL_FRAMEBUFFER_SRGB);[/code] which enables the conversion to sRGB after blending.[/QUOTE]
Cool, thanks. I've read that this enable only affects sRGB framebuffers. Does that mean the default framebuffer is one such framebuffer? Another quick question, how does glViewport work? It doesn't seem to scale linearly, where (0,0,w/2,h/2) gives me a lot lot less than a fourth of the screen size.
[QUOTE=WTF Nuke;41567778]Cool, thanks. I've read that this enable only affects sRGB framebuffers. Does that mean the default framebuffer is one such framebuffer? Another quick question, how does glViewport work? It doesn't seem to scale linearly, where (0,0,w/2,h/2) gives me a lot lot less than a fourth of the screen size.[/QUOTE]
It only depends on the pixel format, so the default buffer may support it.
In c# is there any way of doing something like this...
[code]if ( 2 < x <= 10)
{
// Do Something
}[/code]
rather than something like this...
[code]if ( 2 < x && x <= 10)
{
// Do Something
}[/code]
[QUOTE=Pelf;41568414]In c# is there any way of doing something like this...
[code]if ( 2 < x <= 10)[/code]
rather than something like this...
[code]if ( 2 < x && x <= 10)[/code][/QUOTE]
Not unless you use a function like this one:
[code]
private bool InRange(int numberToCheck, int bottom, int top)
{
return (numberToCheck > bottom && numberToCheck < top);
}
[/code]
And then use
[code]
if(InRange(x, 2, 10)) {
// Well, it's something.
}
[/code]
[QUOTE=Tamschi;41568167]It only depends on the pixel format, so the default buffer may support it.[/QUOTE]
Is it safe to assume that GPUs that can run 3.3 have sRGB framebuffer support?
[QUOTE=WTF Nuke;41569348]Is it safe to assume that GPUs that can run 3.3 have sRGB framebuffer support?[/QUOTE]
It's an extension, so not for production use.
You could relatively easily fall back to post-processing if it's not available though.
I'm super anxious atm about doing this, which is for an application to a programming course that guarantees a 60k job:
[quote](1) a URL to a private, 1-minute (max) video of you introducing yourself and explaining something technical related to programming. -[/quote]
Thinking of doing something simple and about functions, and how they're useful for DRY programming (which is a big part of Django~ which is the course I'm applying for).
[quote]
(2) a URL to your best-foot-forward code sample(s). If you do not yet have a Github.com account, we highly recommend you set one up, add code there, and send us your Github account URL. Otherwise, sending us a URL to a website that you have coded (to any degree) works as well. [/quote]
I'm thinking of just giving my solutions to [url]https://www.codeeval.com/[/url] questions, and maybe the gate controller program I'm working on...
any tips? I'm pretty nervous!
You read the whole file, instruct the OS to notify you of changes and wait until a change occurs, in which case you display what was added.
You might want to check if the file was not completely replaced or something was changed in the middle instead of just some text appended.
I don't think there's a portable solution, but you can probably find some cross-platform libraries that support this.
For UNIX-like systems you can look for implementations of the tail program; it does that with the -f (=follow) flag.
Anyone has experience with Farseerphysics? (Using it together with SFML.NET not Xna)
I created a simple test setup. Click the screen and a dynamic square falls down. There is a static square somewhere on the scene too.
But whenever they collide, they do it in a strange manner. The dynamic squares kinda fall into each other and start vibrating.
The collision between the dynamic and static squares is also quite odd. They do collide, but when the dynamic square should rotate and fall of the side, it just stops and sits at the edge. When a dynamic square rests on top of the static one, and another dynamic square falls on top, it pushes the resting one trough the static one witouth any resistance. Messing with the scalefactor improves it slightly, but the behaviour generally changes the same.
I am aware that 1px != 1 simunit. But changing the scale of the collision box gives the same behaviour.
My code can be found here:
[url]https://gist.github.com/arxae/f98b5d3a10025c90ae42[/url]
Any recommendations, or personal experience, I can use for getting started with some low level code?
I am trying to comprehend concurrent and forked processes, as issues of buffering and memory stacks is blowing my mind. With all these articles about parallel computing with clusters and what-not, I am looking for a way to get my foot into the door.
Sorry, you need to Log In to post a reply to this thread.