im getting an error with sfml saying that [close..Theres more] is not a part of sf:Window
here is my code
this->window = new sf::RenderWindow(window_bounds, title); this->window->setFramerateLimit(framerate_limit); this->window->setVerticalSyncEnabled(vertical_sync_enabled);
can anyone help?
Related
Hey guys I'm new in c++ wxwidgets programming.
I would like to know the easiest way to put an image into a button.
I tried :
button1 = new wxBitmapButton(side_panel, wxID_ANY, wxBitmap("image.png",wxBITMAP_TYPE_PNG), wxPoint(150,30), wxSize(30, 30),wxBORDER_NONE);
But I always get the same error:
If you expand the error dialog you see, you should see more information about the error, but my guess is that the image simply can't be found. You should check that the file image.png indeed exists in the current working directory of your program, i.e. the directory that you run it from, assuming you don't change it later.
You should also actually check for errors in your programs, even simple ones, i.e.
wxBitmap bmp("image.png");
if (!bmp.IsOk()) {
... handle the error somehow instead of blithely using an invalid bitmap ...
}
Hello Techie's I am working on Qt QMediaPlayer and trying to play song through my local file but i don't know where I am getting wrong I am unable to play song on Window but the same code is working fine in Mac but not on window.
For all kind helps Thanks in advance.
I had tried this
player->setMedia(QUrl::fromLocalFile("<path to file>/test.mp3"));
and this as well
player->setMedia(QMediaContent(QUrl::fromLocalFile("<path to file>/test.mp3")));
Here's my complete code snippet:
QMediaPlayer *player = new QMediaPlayer();
player->setMedia(QUrl::fromLocalFile("<path to file>/test.mp3"));
player->setVolume(100);
player->play();
qDebug() << player->errorString();
No error listed, so its difficult to identify where I am getting wrong.
Have you try some path format, i had a similar experience with QMediaPlayer and i had to use path format like this some\\path\\exemple.mp3 or like this some//path//exemple.mp3 i don't remember exactly.
Maybe check QMediaPlayer exemple and try to run the exemple to check if is codec problem or a code problem.
I am looking for an equivalent of this solution from SDL to get the window handle from QT(5.12) on OSX (Mojave)
SDL_SysWMinfo wmInfo = {};
SDL_GetWindowWMInfo(window, &wmInfo);
mInfo.info.cocoa.window;
I tried a solution which I found on stack
NSWindow* window = [[NSWindow alloc] initWithContentRect:NSMakeRect(500, 500, 500, 500)
styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask
backing:NSBackingStoreBuffered
defer:NO];
But it fails with the error message
expected variable name or this in lambda capture list
I tried it via the QWidget
QWidget window;
window.resize(320, 240);
window.show();
window.winId()
window.windowHandle()
I tried to use the QMacNativeWidget but it failed, too.
I tried to fool around with this imports
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <AppKit/NSWindow.h>
But NSWindow.h throws a lot of error messages. It complains for example about missing braces.
So I can't find any documentation which helps me and I am working after the try and error principle which is not the most productive one^^
Maybe one of you had already the same issue and could provide some help or reference
Topic In Cocos2d-android game:
To delete the sprite after collided with another sprite, i have used spriteRect function, but this isnt making the sprite to get removed after intersect, after lot of googling got to know that it should be deleted from parent,
here's the code
CGRect ship1Rect = CGRect.make(ship1.getPosition().x - (ship1.getContentSize().width/2),
ship1.getPosition().y - (ship1.getContentSize().height/2),
ship1.getContentSize().width,
ship1.getContentSize().height);
if (CGRect.intersects(targetRect, ship1Rect))
{
parent.removeChildByTag(17, true);
}
but here parent.removeChildByTag(17, true); in this line getting error as "parent cannot be resolved" error, where am i going wrong please can anybody tell
ship1.getParent().removeChild(ship1,true);
or
ship1.getParent(). removeChildByTag(17,true);
You can use only
removeChild(ship1,true);
insteasd of
parent.removeChildByTag(17, true);
I am using CEF3 (chrome embedded framework) in my win32 application, while I am running the application I get a weird error message -
I am coming from a C# development background, and here in C++ I don't see how I can inspect my error and figure out why it's complaining about my code.
How can I check the error message? If not - how you debug this kind of errors in Visual Studio?
This the code which triggering the error -
case WM_CREATE:
{
CefRefPtr<CefClient> clientHandler = new ClientHandler();
RECT rect;
GetClientRect(hWnd, &rect);
CefWindowInfo info;
info.SetAsChild(hWnd, rect);
// Browser initialization settings.
CefBrowserSettings settings;
// Create the new browser window object asynchronously.
std::string startupUrl = "http://www.google.com/";
CefBrowserHost::CreateBrowser(info, clientHandler, startupUrl, settings);
}
break;
I don't want help in CEF3 (but I will appreciate it) I just want to know how to debug this kind of errors in Visual Studio.
The Output window of the debugger tells you what exception was thrown.
Also, you can click "Break" in the dialog that appears and VS will take you to the line on which the exception was thrown. You'll see a yellow arrow to the left of the line.
Finally, if the exception is not fatal, you can catch it and ignore it:
try
{
...
}
catch (const SomeException&)
{
// do nothing
}
I had problems building in Release. The problem was that I didn't called CefInitialize at all.